Capistrano for Rails 3.1 [英] Capistrano for Rails 3.1

查看:211
本文介绍了Capistrano for Rails 3.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



没有这样的文件或目录



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



错误。搜索互联网,我发现一些博客帖子建议

  set:normalize_asset_timestamps,false 

删除了这些问题。但是,我不知道我是否正在做
正确的事情,因为预编译仍然失败,我是新的Rails 3.1。

  rake RAILS_ENV = production RAILS_GROUPS =资产资产:预编译

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

我设置

 加载'部署/资产'
在deploy.rb中设置:rake,bundle exec rake

,但没有帮助。仍然帽部署抱怨说它找不到某些宝石



提前感谢任何帮助。



Steve


解决方案

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



对于RVM,我的设置是:

 #加载RVM的capistrano插件。 
需要rvm / capistrano
set:rvm_path,$ HOME / .rvm
set:rvm_ruby_string,<在这里插入您的RVM设置>
set:rvm_type,:user#不要使用系统范围的RVM

我的包设置为:

 #如果您不使用bundler 
set,则将这两行注释:bundle_roles,[: app]
require'bundler / capistrano'


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

解决方案

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'

这篇关于Capistrano for Rails 3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆