I try to use this tutorial, but have some problems with scaffold generation code.
application.rb
Bundler.require(:default, Rails.env) if defined?(Bundler)
#if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
# Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
#end
Take solution from this topic, but not well for this problem.
Log:
C:\Users\Evgeny\Rails_projects\demo_app>rails generate scaffold User name:string
email:string
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/ra
iltie/configuration.rb:77:in `method_missing': undefined method `assets' for #<R
ails::Application::Configuration:0x3a03248> (NoMethodError)
from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:55:in
`<class:Application>'
from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:14:in
`<module:DemoApp>'
from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:13:in
`<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9
/lib/rails/commands.rb:15:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9
/lib/rails/commands.rb:15:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Config app:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
gem 'sqlite3', '1.3.3'
It’s something with assets. I think you need to upgrade your rails to 3.1 at least. 3.2.3 is better.
Try to create new project with last version of rails 3.2.3.
or try this solution http://railscasts.com/episodes/282-upgrading-to-rails-3-1 or last chapter of tutorial book http://russian.railstutorial.org/chapters/rails-3-1#top .
One more solution without upgrading, but I’m not sure. In your config/application.rb try to find config.assets.enabled and set it to false.