0

I attempted to generate a migration like:

rails generate migration RemovefromGenotypes box:integer well:string 

but then I get this error:

/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>' 

I have no clue where to start to debug this, but would certainly appreciate it if anyone could point me in the right direction...

Thanks! --rick

2
  • Forgot to mention: I'm using Rails 2.3.5 and Ruby version: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] Commented Jun 5, 2012 at 23:44
  • try underscore version that all i can say remove_column_from_genotypes box:integer well:string Commented Jun 10, 2012 at 8:31

2 Answers 2

3

Happened to me while installing rails 2.3.14 after rails 3.2.6

It seems rails 2.3 overwrites some rails 3 files. Fixed by removing 2.3 and reinstalling 3.2

Sign up to request clarification or add additional context in comments.

Comments

2

I have same issue. Use following command and problem gone

 gem install rails 

This will install updated rails and all thing working find again.

2 Comments

Thanks...however, this did not work. I ran the command, but I still get the same error when I start rails:
Well, what finally worked was to remove and reinstall ruby. Thanks to other helpful messages, I used this to remove all gems:gem list --no-version | sudo xargs gem uninstall $1 -a -x, and then used rvm to reinstall: rvm install 1.9.3

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.