rails/rails — Issue #3291: Assets not loading with Rails 3.1.1
Author: conradwt
Created: 2011-10-11 09:31:00+00:00
State: open

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:

Gemfile:

source 'http://rubygems.org'
source 'http://gems.github.com'

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'
end

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

Capfile:

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

Message:

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