gpt4 book ai didi

ruby-on-rails - capistrano 在 [] 中找不到 bundler (>= 0) (Gem::LoadError)

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

通过 capistrano 部署 rails 应用程序时,出现以下错误:

[example.com] executing command
** [out :: example.com] /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [] (Gem::LoadError)
** [out :: example.com] from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
** [out :: example.com] from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
** [out :: example.com] from /usr/local/bin/bundle:22:in `<main>'
command finished in 181ms

我已将 ruby​​ 安装到/usr/local,我没有使用任何类似 RVM 的东西。这是我的 deploy.rb:
 require 'bundler/capistrano'
load 'deploy/assets'

set :default_environment, {
'PATH' => "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:$PATH",
"RUBY_VERSION" => "ruby 1.9.3",
"GEM_HOME" => "/usr/local/lib/ruby/gems/1.9.1/gems",
"GEM_PATH" => "/usr/local/lib/ruby/gems/1.9.1/gems",
"BUNDLE_PATH" => "/usr/local/lib/ruby/gems/1.9.1/gems"
}

set :application, "appname"
set :repository, "git@github.com/something.git"
set :user, "thebestuserever"
set :scm_username, "somegithubaccount"
set :use_sudo, true
set :branch, "master"
ssh_options[:forward_agent] = true
default_run_options[:pty] = true

set :scm, :git
set :deploy_to, "/application/path"

role :web, "example.com"
role :app, "example.com"
role :db, "example.com", :primary => true

namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end

[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :domain do ; end
end
end

task :after_update_code do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
run "cd #{release_path}; rake assets:precompile RAILS_ENV=production "
run "cd #{release_path}; ./script/delayed_job restart"
end

我确定我只是在这里遗漏了一些简单的东西。但我似乎无法找到它。

最佳答案

我删除了 set :default_environment打电话。我在一个较旧的脚本中使用了它,我认为它主要用于 RVM 而不是系统安装。摆脱它修复了它。所以我猜这条路不知何故搞砸了。

关于ruby-on-rails - capistrano 在 [] 中找不到 bundler (>= 0) (Gem::LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14508524/

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