Capistrano for Rails 3.1

发布于 2024-12-10 11:01:33 字数 586 浏览 0 评论 0原文

我正在使用 Rails 3.1 和 Capistrano,我收到

No such file or directory

/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 部署抱怨它找不到某些宝石,

提前感谢您的帮助。

史蒂夫

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌路终见情 2024-12-17 11:01:33

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

我的捆绑器设置是:

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

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'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文