gpt4 book ai didi

Capistrano Rails Assets 预编译错误

转载 作者:行者123 更新时间:2023-12-04 04:47:25 26 4
gpt4 key购买 nike

我有一个 Capistrano 脚本,它将我的应用程序部署到 Amazon EC2 机器上。编译 Assets 时失败:

* executing "cd -- /home/ec2-user/uc_social_server/releases/20130731161645 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile"
servers: ["ec2-23-22-188-11.compute-1.amazonaws.com"]
[ec2-23-22-188-11.compute-1.amazonaws.com] executing command
** [out :: ec2-23-22-188-11.compute-1.amazonaws.com] Could not find thread_safe-0.1.0 in any of the sources
** [out :: ec2-23-22-188-11.compute-1.amazonaws.com]
** [out :: ec2-23-22-188-11.compute-1.amazonaws.com] Run `bundle install` to install missing gems.
** [out :: ec2-23-22-188-11.compute-1.amazonaws.com]
command finished in 591ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/ec2-user/uc_social_server/releases/20130731161645; true"
servers: ["ec2-23-22-188-11.compute-1.amazonaws.com"]
[ec2-23-22-188-11.compute-1.amazonaws.com] executing command
command finished in 201ms
failed: "sh -c 'cd -- /home/ec2-user/uc_social_server/releases/20130731161645 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile'" on ec2-23-22-188-11.compute-1.amazonaws.com

最佳答案

将以下内容添加到 deploy.rb

require "bundler/capistrano"
require "rvm/capistrano"
before "deploy:assets:precompile", "bundle:install"

并跟随到 Capfile
load 'deploy/assets'

并关注 Gemfile
gem 'rvm-capistrano'

为我解决了这个问题。如果您不使用 rvm,也许您不需要 rvm/capistrano 或 rvm-capistrano gem。

关于Capistrano Rails Assets 预编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17976487/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com