我尝试生成如下的迁移:
rails generate migration RemovefromGenotypes box:integer well:string
然后我收到了这个错误:
/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/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/caseyr/.rvm/rubies/ruby-1.9.3-p194/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 /home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/share/rails-ruby1.8/railties/bin/rails:14:in `<main>'
我不知道从哪里开始调试这个,但如果有人能指出我正确的方向,我一定会很感激...
谢谢! --rick
答案 0 :(得分:3)
在rails 3.2.6
之后安装rails 2.3.14时发生了似乎rails 2.3覆盖了一些rails 3文件。通过删除2.3并重新安装3.2
来修复答案 1 :(得分:2)
我有同样的问题。使用以下命令和问题
gem install rails
这将安装更新的rails并重新找到所有工作。