我运行rails new时出错。铁路问题?

时间:2012-06-14 18:26:36

标签: ruby-on-rails ruby rubygems

我正在关注Ruby on Rails教程,我在第2章。当我输入命令

rails new demo_app

此错误溢出。我试过寻找解决方案,但没有一个答案匹配。我尝试卸载/重新安装railties和rails但仍然得到相同的错误。

         run  bundle install
Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.
6/lib/rails/generators/app_base.rb:254:in ``': No such file or directory - ""Z:/
Program Files/RailsInstaller/Ruby1.9.3/bin/ruby.exe"" -rubygems "Z:/Program File
s/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle" i
nstall (Errno::ENOENT)
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
railties-3.2.6/lib/rails/generators/app_base.rb:254:in `bundle_command'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
railties-3.2.6/lib/rails/generators/app_base.rb:258:in `run_bundle'
        from (eval):1:in `run_bundle'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/task.rb:27:in `run'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/invocation.rb:126:in `block in invoke_all'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/invocation.rb:126:in `each'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/invocation.rb:126:in `map'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/invocation.rb:126:in `invoke_all'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/group.rb:238:in `dispatch'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
thor-0.15.2/lib/thor/base.rb:408:in `start'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
railties-3.2.6/lib/rails/commands/application.rb:38:in `<top (required)>'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/
rubygems/custom_require.rb:55:in `require'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/
rubygems/custom_require.rb:55:in `require'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
railties-3.2.6/lib/rails/cli.rb:15:in `<top (required)>'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/
rubygems/custom_require.rb:55:in `require'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/
rubygems/custom_require.rb:55:in `require'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/
railties-3.2.6/bin/rails:7:in `<top (required)>'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/bin/rails:19:in `load'
        from Z:/Program Files/RailsInstaller/Ruby1.9.3/bin/rails:19:in `<main>'

有什么建议吗?谢谢。

1 个答案:

答案 0 :(得分:0)

不是答案,而是解决方案。

所以我放弃并卸载了railsinstaller并重新安装在Z:\目录中。 “程序文件”中的空格引起了太多问题,而不仅仅是这个问题。 (虽然我在使用RoR教程时所使用的基本教程应用程序似乎没有任何问题。)

此后,bundle install命令工作正常。我确信还有另一种方式可以通过这个空间,但我不知道怎么做,我认为不值得这么麻烦。

我希望这有助于某人。我还评论了与空间问题相关的一些答案,所以如果你有其他问题,我的历史可能有所帮助。