加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 无法让bundle exec在生产中工作

发布时间:2020-12-16 20:44:53 所属栏目:百科 来源:网络整理
导读:我已经将我的宝石安装在生产中: cd /app/releases/current bundle install --gemfile /app/releases/current/Gemfile --path /app/shared/bundle --deployment --quiet --without development test 我无法绑定exec任何我的宝石(除了耙子和宝石): $bundle e
我已经将我的宝石安装在生产中:
cd /app/releases/current && bundle install --gemfile /app/releases/current/Gemfile --path /app/shared/bundle --deployment --quiet --without development test

我无法绑定exec任何我的宝石(除了耙子和宝石):

$bundle exec whenever
bundler: command not found: whenever
Install missing gem executables with `bundle install`

宝石正确安装在/ app / shared / bundle中:

$cd /app/shared
$find . -name whenever
./bundle/ruby/1.9.1/gems/whenever-0.6.8/bin/whenever
./bundle/ruby/1.9.1/gems/whenever-0.6.8/lib/whenever

我的(生成)软件包配置(在/app/current/.bundle/config中)是:

---
BUNDLE_FROZEN: "1"
BUNDLE_PATH: /app/shared/bundle
BUNDLE_DISABLE_SHARED_GEMS: "1"
BUNDLE_WITHOUT: development:test

我正在运行ruby 1.9.2p290,手动安装到/usr/local / bin.

我必须使用–binstubs选项捆绑安装我的宝石吗?为什么不绑定exec要搜索存储的BUNDLE_PATH?

解决方法

使用Capistrano和Rails,并使用deploy.rb作为deployer文件.

我意识到,改变出现的顺序需要“每当/ capistrano”真的很重要.我把它放在几乎最后一行:

在deploy.rb中:

#first lines:
set :rvm_ruby_string,"1.9.3"
set :rvm_type,:user
set :whenever_command,"bundle exec whenever"

# others...

# last lines
require 'rvm/capistrano'
require 'bundler/capistrano'
require "whenever/capistrano"

after "deploy:update_code","customs:config"
after "deploy:create_symlink","deploy:create_symlink"
after "deploy","deploy:cleanup"

load 'deploy/assets'
# end

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读