Rick Casey
2012-Jun-06 21:25 UTC
why to get the error ''undefined method `write_inheritable_attribute''''
I started getting this error message when I attempt to do some rake tasks: $ rails destroy scaffold genotypes /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 found a related old message here that seemed to indicate my problem might be caused because I did not install gems as root, so here is what my gem environment looks like: $ gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.8.21 - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i486-linux] - INSTALLATION DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /home/caseyr/.rvm/gems/ruby-1.9.3-p194 - /home/caseyr/.rvm/gems/ruby-1.9.3-p194@global - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/ Can anyone tell if this is incorrect? Do I need to uninstall and reinstall gems? Any suggestions much appreciated... --rick -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2012-Jun-07 06:48 UTC
Re: why to get the error ''undefined method `write_inheritable_attribute''''
On 6 June 2012 22:25, Rick Casey <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I started getting this error message when I attempt to do some rake > tasks: > > $ rails destroy scaffold genotypes > /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 found a related old message here that seemed to indicate my problem > might be caused because I did not install gems as root, so here is what > my gem environment looks like:If you are using rvm then you should not install gems as root. Does it fix the problem if you do rvm rake whatever Colin> > $ gem environment > RubyGems Environment: > - RUBYGEMS VERSION: 1.8.21 > - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i486-linux] > - INSTALLATION DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194 > - RUBY EXECUTABLE: /usr/bin/ruby1.8 > - EXECUTABLE DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194/bin > - RUBYGEMS PLATFORMS: > - ruby > - x86-linux > - GEM PATHS: > - /home/caseyr/.rvm/gems/ruby-1.9.3-p194 > - /home/caseyr/.rvm/gems/ruby-1.9.3-p194@global > - GEM CONFIGURATION: > - :update_sources => true > - :verbose => true > - :benchmark => false > - :backtrace => false > - :bulk_threshold => 1000 > - REMOTE SOURCES: > - http://rubygems.org/ > > Can anyone tell if this is incorrect? Do I need to uninstall and > reinstall gems? > > Any suggestions much appreciated... > > --rick > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.