Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 未找到rails 4 rbenv包_Ruby On Rails 4_Bundler_Capistrano3 - Fatal编程技术网

Ruby on rails 4 未找到rails 4 rbenv包

Ruby on rails 4 未找到rails 4 rbenv包,ruby-on-rails-4,bundler,capistrano3,Ruby On Rails 4,Bundler,Capistrano3,我正在尝试将带有Ruby 2.2.3和Capistrano 3的Rails 4.2.4应用程序部署到VPS服务器。我以前用RVM做过几次,其他应用也没有问题,但现在我在一台新机器上和服务器上使用rbenv,我得到了如下stacktrace: DEBUG [a326a4c8] Command: cd /home/deploy/myapp/releases/20151226231303 && /usr/bin/env bundle install --path /home/deplo

我正在尝试将带有Ruby 2.2.3和Capistrano 3的Rails 4.2.4应用程序部署到VPS服务器。我以前用RVM做过几次,其他应用也没有问题,但现在我在一台新机器上和服务器上使用rbenv,我得到了如下stacktrace:

DEBUG [a326a4c8] Command: cd /home/deploy/myapp/releases/20151226231303 && /usr/bin/env bundle install --path /home/deploy/myapp/shared/bundle --without development test --deployment --quiet
DEBUG [a326a4c8]    /usr/bin/env: 
DEBUG [a326a4c8]    bundle: No such file or directory
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@youspoof.us: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing as deploy@youspoof.us: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory
部署.rb

# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'myapp'
set :repo_url, 'git@github.com:shakycode/myapp.git'

set :deploy_to, '/home/deploy/myapp'

set :linked_files, %w{config/database.yml config/secrets.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :publishing, 'deploy:restart'
  after :finishing, 'deploy:cleanup'
end
我可能遗漏了一些东西,但每次尝试运行
cap production deploy
时,我都会收到关于/usr/bin/env bundle的调试错误,没有这样的文件或目录


非常感谢您的帮助。同时,我会继续用谷歌搜索。

我自己也能独家经营这个

卡普里 deploy.rb
我自己能做这个

卡普里 deploy.rb
如果需要,您可以使用
set:rbenv\u type,:user
而不是设置rbenv路径。@will\u in\u谢谢,我实际上已经将它们都设置好了。我是否应该删除路径并保留rbenv_类型?如果需要,您可以使用
set:rbenv_类型,:user
而不是设置rbenv路径。@will_in_,谢谢,我实际上已经将它们都设置好了。我应该删除路径并只保留rbenv_类型吗?
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'myapp'
set :repo_url, 'git@github.com:shakycode/myapp.git'

set :deploy_to, '/home/deploy/myapp'

set :linked_files, %w{config/database.yml config/secrets.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :publishing, 'deploy:restart'
  after :finishing, 'deploy:cleanup'
end
require 'capistrano/rbenv'
set :rbenv_path, '/home/deploy/.rbenv/'