Capistrano for Rails 3.1

Ste*_*man 7 deployment capistrano assets bundler rails-3.1

我使用的是Rails 3.1和Capistrano

没有相应的文件和目录

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

错误.在互联网上搜索,我发现了许多博客帖子

set :normalize_asset_timestamps, false
Run Code Online (Sandbox Code Playgroud)

这消除了这些问题.但是,我不确定我是否正在做正确的事情因为预编译仍然失败并且我是Rails 3.1的新手.

rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
Run Code Online (Sandbox Code Playgroud)

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

我设置

load 'deploy/assets'
set :rake,      "bundle exec rake"
Run Code Online (Sandbox Code Playgroud)

在deploy.rb但它没有帮助.仍有帽子部署抱怨它无法找到某些宝石

在此先感谢您的帮助.

史蒂夫

eng*_*ave 0

这确实为我解决了错误。如果您使用的是捆绑器和 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
Run Code Online (Sandbox Code Playgroud)

我的捆绑器设置是:

# Comment these two lines out if you aren't using bundler
set :bundle_roles, [:app]
require 'bundler/capistrano'
Run Code Online (Sandbox Code Playgroud)