我正在使用 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 但它没有帮助。 Still cap deploy 提示它找不到某些 gem
在此先感谢您的帮助。
史蒂夫
最佳答案
这确实为我解决了错误。如果您使用的是 bundler 和 rvm,请确保您的设置正确。可以通过 rvm capistrano 或 rvm bundler 的快速谷歌找到更多信息,但我在 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
我的 bundler 设置是:
# Comment these two lines out if you aren't using bundler
set :bundle_roles, [:app]
require 'bundler/capistrano'
关于deployment - 用于 Rails 3.1 的 Capistrano,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7774671/