Before writing this question I looked at these answers, but was unable to find a solution.:
Error when execute rails generate scaffold User name:string email:string
rake aborted! undefined method `migration_error=' for ActiveRecord::Base:Class
Error launching Rails server: undefined method 'configure'
When I try to start a new application (for Hartl's tutorial, Chapter 2), at the stage scaffold start, I got an error like:
**undefined method `configure' for #<SampleApp2::Application:0x00000101a74610> (NoMethodError)**
But thanks to the above examples, I edited the development.rb file:
DemoApp::Application.configure do
(Yes, my application is called demo_app so I transformed its name).
After that, I tried to run scaffold again but got a new error:
**method_missing': undefined method raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)**
In response to similar cases indicates a migration method - that it should be removed from the file development.rb. Similarly, I tried to find in this file raise_in_transactional_callbacks method, but it's not there!
In addition, I would say that the full code that produces in cmd is very large:
C:Sitesdemo_app>rails generate scaffold User name:string email:string
invoke active_record
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.2/lib/active_record/railtie.rb:166:in `block (3 levels) in <class:Railtie>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.2/lib/active_record/railtie.rb:165:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.2/lib/active_record/railtie.rb:165:in `block (2 levels) in <class:Railtie>'
…
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:48:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Where the ...(ellipsis) - specially cut similar code.
That's all. I would be grateful for any help!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…