我仍然是Rails和Ruby的新手 - 在升级到新版本的Ubuntu(11.04)后,我的rails安装无法正常工作。我已经尝试更新Rails,并更新我使用RVM安装的版本,但没有一个工作。
这是终端输出:
/usr/share/rails-ruby1.8/railties/lib/rails_generator/options.rb:32:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
from /usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:90:in `<class:Base>'
from /usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:85:in `<module:Generator>'
from /usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:48:in `<module:Rails>'
from /usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:6:in `<top (required)>'
from /home/alec/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/alec/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/share/rails-ruby1.8/railties/lib/rails_generator.rb:34:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/share/rails-ruby1.8/railties/bin/rails:14:in `<main>'
从那以后,我特意尝试更新铁路,但这也不起作用。自从我第一次收到错误以来,输出没有改变。
答案 0 :(得分:0)
问题是导轨恢复到2.3.5。我不得不卸载rails并设置一个gemset,如下所述:Every time I close terminal rails defaults back to 2.3.5 from 3.0.3?
答案 1 :(得分:0)
我建议你看看RVM。它是迄今为止在* NIX平台上管理Ruby和Rails安装的最佳方式。