rails/rails — Issue #4054: controller generator is broken when app is created with -S
Author: rosenfeld
Created: 2011-12-20 13:38:59+00:00
State: open

Removing the assets group from Gemfile will fix the problem. Otherwise, running "rails g controller" will yield this error:

rails new empty -S
cd empty
rails g controller

/home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `context_class' for nil:NilClass (NoMethodError)
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/sass-rails-3.1.5/lib/sass/rails/railtie.rb:61:in `block in '
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/rodrigo/temp/rails/empty/config/environment.rb:5:in `'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/application.rb:83:in `require'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
from /home/rodrigo/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:22:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'