Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rack error (not compiling on the fly) serving assets in development

Serving assets has started creating this error today:

!! Rack application returned nil body. Probably you wanted it to be an empty string?
!! Unexpected error while processing request: undefined method `each' for nil:NilClass

I am using coffeescript and SCSS (application.js.coffee and application.css.scss)

From Gemfile:

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'compass-rails'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'marionette-rails'
  gem 'uglifier', '>= 1.0.3'
end

Using ruby 1.9.3-p392 and 1.9.3-p125 causes this problem. Google results for this error are near non-existant.

like image 264
w2bro Avatar asked Mar 30 '13 01:03

w2bro


2 Answers

Will's answer above fixed it for me in one case, however I reached this issue again in another project and have found a similarity between the two.

Caching in development is causing this issue, in development.rb simply add/update the following line and restart the application:

config.action_controller.perform_caching = false

like image 165
w2bro Avatar answered Sep 20 '22 04:09

w2bro


I was getting this same issue for a couple of days. I believe that the issue was caused by a conflict between the latest version of rails and older gems. Updating your gems should solve the issue (it did for me).

like image 25
Will Hitchcock Avatar answered Sep 22 '22 04:09

Will Hitchcock