gpt4 book ai didi

ruby-on-rails - ubuntu 上的 capistrano 部署错误 - 找不到捆绑程序

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

这是在 ubuntu 和 rvm 上使用 cap deploy 执行 deploy.rb 的输出:

执行 .../bin/bundle install vendor/gem 时,出现错误:

  * executing "cd /vol/www/emclab/current && /home/dtt/.rvm/gems/ruby-1.9.2-p290/bin/bundle install vendor/gems"
servers: ["12.34.56.78"]
[12.34.56.78] executing command
*** [err :: 12.34.56.78] /home/dtt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)
*** [err :: 12.34.56.78] from /home/dtt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
*** [err :: 12.34.56.78] from /home/dtt/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
*** [err :: 12.34.56.78] from /home/dtt/.rvm/gems/ruby-1.9.2-p290/bin/bundle:18:in `<main>'
command finished in 624ms
failed: "sh -c 'cd /vol/www/emclab/current && /home/dtt/.rvm/gems/ruby-1.9.2-p290/bin/bundle install vendor/gems'" on 12.34.56.78

这是 cap invoke COMMAND='which bundle' 的输出:
 ** [out :: 12.34.56.78] /usr/local/bin/bundle

这是deploy.rb:
set :application, "myapp"
set :repository, "git://github.com/myapp/myapp.git"
set :scm, :git
set :user, "dtt"
set :use_sudo, true
set :scm_passphrase, "phrase"
set :branch, "master"
set :deploy_to, "/vol/www/#{application}"
#set :deploy_via, :remote_cache

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

server "12.34.56.78", :web, :app, :db, :primary => true
#role :web, "your web-server here" # Your HTTP server, Apache/etc
#role :app, "your app-server here" # This may be the same as your `Web` server
#role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run
#role :db, "your slave db-server here"

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

after "deploy", "deploy:bundle_gems"
after "deploy:bundle_gems", "deploy:restart"
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :bundle_gems do
run "cd #{deploy_to}/current && /home/dtt/.rvm/gems/ruby-1.9.2-p290/bin/bundle install vendor/gems"
end
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end

关于错误的任何建议?谢谢。

最佳答案

获取 cap 以连接并告诉您捆绑包的安装位置

cap invoke COMMAND='which bundle'

如果未找到 bundle 命令,则说明您的 PATH 设置不正确。您可能需要 PermitUserEnvironment在该主机上运行的 sshd 中。然后可以在部署用户的 .ssh/environment中手动设置路径文件。

关于ruby-on-rails - ubuntu 上的 capistrano 部署错误 - 找不到捆绑程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8002403/

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