Capistrano for Rails 3.1

岁酱吖の 提交于 2019-12-07 00:45:38

问题


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:


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'


来源:https://stackoverflow.com/questions/7774671/capistrano-for-rails-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!