7

我正在使用 Rails 3.1 和 Capistrano,我得到了

没有这样的文件或目录

/public/images、/public/stylesheets 和 public/javascripts 的错误

错误。在网上搜索,我发现了一些博文提示

set :normalize_asset_timestamps, false

这消除了这些问题。但是,我不确定我是否做对了,因为预编译仍然失败,而且我是 Rails 3.1 的新手。

rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile

在生产服务器上仍然失败。

我设置

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

在 deploy.rb 但它没有帮助。仍然 cap deploy 抱怨它找不到某些宝石

提前感谢您的帮助。

史蒂夫

4

1 回答 1

0

这确实为我解决了错误。如果您使用的是 bundler 和 rvm,请确保您的设置正确。可以通过 rvm capistrano 或 rvm bundler 的快速 google 找到更多信息,但我在 deploy.rb 中的设置如下:

对于 RVM,我的设置是:

# 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

我的捆绑器设置是:

# Comment these two lines out if you aren't using bundler
set :bundle_roles, [:app]
require 'bundler/capistrano'
于 2011-11-23T17:12:18.613 回答