Capistrano for Rails 3.1

2k Views Asked by At

I am using Rails 3.1 and Capistrano, I get

No such file or directory

errors for /public/images, /public/stylesheets, and public/javascripts

errors. Searching the Internet, I found a number of blog posts suggesting

set :normalize_asset_timestamps, false

which removed these problems. However, I am not sure if I am doing the right thing since precompile still fails and I am new to Rails 3.1.

rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile

still fails on the production server.

I set

load 'deploy/assets'
set :rake,      "bundle exec rake"

in deploy.rb but it doesn't help. Still cap deploy complains that it cannot find certain gems

Thanks in advance for any help.

Steve

1

There are 1 best solutions below

0
On

That does indeed fix the error for me. If you're using bundler and rvm make sure your settings are correct. More info can be found with a quick google of rvm capistrano or rvm bundler but my settings in deploy.rb are below:

For RVM my settings are:

# Load RVM's capistrano plugin.
require "rvm/capistrano"
set :rvm_path, "$HOME/.rvm"
set :rvm_ruby_string, <Insert your RVM settings here>
set :rvm_type, :user  # Don't use system-wide RVM

My bundler settings are:

# Comment these two lines out if you aren't using bundler
set :bundle_roles, [:app]
require 'bundler/capistrano'