我对RoR很新,我的计算机上有几个工作轨道应用程序,但我一定做错了,因为现在我无法创建新的应用程序。问题在于我这样做:
$ rake db:migrate
我明白了:
anarres@supakewl:~/prog/rails3/myapp$ rake db:migrate
(in /home/anarres/prog/rails3/myapp)
rake aborted!
Could not find RubyGem bundler (>= 0)
/usr/local/ruby/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error'
/usr/local/ruby/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
/usr/local/ruby/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
/home/anarres/prog/rails3/myapp/config/boot.rb:2:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/anarres/prog/rails3/myapp/config/application.rb:1:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/anarres/prog/rails3/myapp/Rakefile:4:in `<top (required)>'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/ruby/bin/rake:31:in `<main>'
我确实安装了Bundler 1.0.7。我通过
安装它$ sudo gem install bundler
我猜这可能是问题所在,因为我在几个地方读到你不应该使用sudo。但如果我尝试在没有sudo的情况下这样做,我会收到一个权限错误。我正在运行Ubuntu 10.04和Rails 3.0.3。答案 0 :(得分:2)
尝试sudo gem list只是为了确保你的系统上有捆绑包。
此外,如果您正在使用RVM,请确保已为活动VM安装它 - 我已经遇到过几次我已切换到其他RVM,忘记在基础中安装捆绑器gemset并触发一个随后生成此错误的任务。