Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Assets not loading with Rails 3.1.1 #3291

conradwt opened this Issue · 11 comments

2 participants


I just upgraded from 3.1.0 to 3.1.1 and I noticed the assets (i.e. images, javascripts, and stylesheets) are not properly loaded when running production locally in Mac OS 10.7.1:


source ''
source ''

gem "rails", "~> 3.1.1"
gem "pg", "~> 0.11.0"
gem "execjs", "~> 1.2.6"
gem 'jquery-rails'
gem "therubyracer", "~> 0.9.4"
gem 'formtastic', '~> 1.1.0'

Gems used only for assets and not required

in production environments by default.

group :assets do
gem 'coffee-rails', "~> 3.1.1"
gem 'sass-rails', "~> 3.1.4"
gem "uglifier", "~> 1.0.3"
# gem 'closure-compiler'

group :test do
# Pretty printed test output
gem 'turn', :require => false


load 'deploy' if respond_to?(:namespace) # cap2 differentiator

Uncomment if you are using Rails' asset pipeline

load 'deploy/assets'

Dir['vendor/gems//recipes/.rb','vendor/plugins//recipes/.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
load 'deploy/assets'

Next, I noticed the 'cap deploy' started failing when attempting to deploy to staging. Thus, I'm seeing the following error message:

$ cap -V
Capistrano v2.9.0


*** [err ::] /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby /home/smartn/ assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
*** [err ::]
*** [err ::] rake aborted!


BTW, I have the following set with the production.rb:

config.assets.compile = true
config.assets.digest = true

Thus, I'm not sure why the 'assets:precompile:nondigest' when I have specified a digest to be enabled when deploying to a production test environment.


you should have config.serve_static_assets = true in production.rb if you want run the app locally in production mode


This resolves the issue of trying to run a production environment locally but deploying to staging is more of a concern at this time.


what's your problem deploying to staging?


$ cap deploy


*** [err ::] /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby /home/smartn/ assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
*** [err ::]
*** [err ::] rake aborted!

This task needs to publicly documented.


this is failing also in 1.9.2-p290?

bundle exec rake assets:precompile fails running locally?


$ ruby -v
ruby 1.9.2p312 (2011-08-11 revision 32926) [x86_64-darwin11.1.0]

$ bundle exec rake assets:precompile

completes without error


The following command actually completes without errors on the production server:

$ bundle exec rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets

However, capistrano executes the following command when dealing with the no digest and fails in production:

$ /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby /home/smartn/ assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets


For now, I have disabled the Capistrano deploy recipe by doing the following:

load 'deploy/assets'

Thus, my deploy goes something like this:

Locally, I do the following:

$ bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets
$ cap deploy
$ rsync -avz public/assets/ user@host:/parent_directory_of_assets/assets/

I may integrate this into my Capistrano recipe at some point depending on the forthcoming status of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.