I found a easy solution. I installed Ruby 1.9.3 and everything goes fine now:
ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
Pergunta
I'm new to Ruby and RoR, and following the first steps of the RoR guide, I got a problem. As they say in the docs, I tried to install RoR and create a new project.
Firstly, running gem install rails
, seemed to me that was a problem with the gem railties
. I ran again gem install rails
and everything seemed to be fine.
But, when I tried to generate the project running rails new my_project
an error appeared during the run bundle install
internal command:
...blablabla
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.0/lib/rails/g
enerators/app_base.rb:331:in ``': No such file or directory - ""C:/Program Files
/Ruby200-x64/bin/ruby.exe"" "C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/ge
ms/bundler-1.6.2/bin/bundle" install (Errno::ENOENT)
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/lib/rails/generators/app_base.rb:331:in `block in bundle_command'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.2
/lib/bundler.rb:235:in `block in with_clean_env'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.2
/lib/bundler.rb:222:in `with_original_env'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.2
/lib/bundler.rb:228:in `with_clean_env'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/lib/rails/generators/app_base.rb:330:in `bundle_command'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/lib/rails/generators/app_base.rb:345:in `run_bundle'
from (eval):1:in `run_bundle'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/command.rb:27:in `run'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/invocation.rb:126:in `invoke_command'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/invocation.rb:133:in `block in invoke_all'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/invocation.rb:133:in `each'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/invocation.rb:133:in `map'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/invocation.rb:133:in `invoke_all'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/group.rb:232:in `dispatch'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thor-0.19.1/l
ib/thor/base.rb:440:in `start'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/lib/rails/commands/application.rb:17:in `<top (required)>'
from C:/Program Files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kerne
l_require.rb:53:in `require'
from C:/Program Files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kerne
l_require.rb:53:in `require'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/lib/rails/cli.rb:14:in `<top (required)>'
from C:/Program Files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kerne
l_require.rb:53:in `require'
from C:/Program Files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kerne
l_require.rb:53:in `require'
from C:/Program Files/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.
0/bin/rails:9:in `<top (required)>'
from C:/Program Files/Ruby200-x64/bin/rails:23:in `load'
from C:/Program Files/Ruby200-x64/bin/rails:23:in `<main>'
I have already deleted the rails
and railties
gems and re-installed them, but nothing changes. Any idea?
Versions:
ruby -v
ruby 2.0.0p353 (2013-11-22) [x64-mingw32]
rails -v
Rails 4.1.0
I'm running on Windows 7 (x64)
Solução
I found a easy solution. I installed Ruby 1.9.3 and everything goes fine now:
ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
Outras dicas
Try install Ruby under its default directory C:\Ruby200 or C:\Ruby200-x64.
first use the command
rails new yourProjectName
then run the command
rails s
to create your server