0

Capistrano を使用して VPS にデプロイしています。私の中でdeploy.rb

require "bundler/capistrano"
server "xxx.xxx.xx.xxx", :web, :app, :db, primary: true
set :application, "riffbox"
set :user, "root"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, "git"
set :repository, "https://xxxx@bitbucket.org/xxxx/iv.git"
set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
after "deploy", "deploy:cleanup" # keep only the last 5 releases

そして、実行中に次のエラーが発生しましたcap deploy:cold

  * 2013-04-13 22:59:38 executing `bundle:install'
  * executing "cd /home/root/apps/riffbox/releases/20130413105936 && bundle install --gemfile /home/root/apps/riffbox/releases/20130413105936/Gemfile --path /home/root/apps/riffbox/shared/bundle --deployment --quiet --without development test"
    servers: ["198.199.74.146"]
    [198.199.74.146] executing command
 ** [out :: 198.199.74.146] **ERROR: Gem bundler is not installed, run `gem install bundler` first.**
 ** [out :: 198.199.74.146] 
    command finished in 915ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/root/apps/riffbox/releases/20130413105936; true"
    servers: ["198.199.74.146"]
    [198.199.74.146] executing command
    command finished in 907ms
**failed: "sh -c 'cd /home/root/apps/riffbox/releases/20130413105936 && bundle install --gemfile /home/root/apps/riffbox/releases/20130413105936/Gemfile --path /home/root/apps/riffbox/shared/bundle --deployment --quiet --without development test'" on 198.199.74.146**

Bundler見つからないエラーと、コマンドの実行に失敗したエラーの 2 つがあることがわかりshます。指示(https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm)に従ってインストールしましたユーザーを使用して VPS の rvm、rubygem、およびレールroot

他に何が欠けていますか?

アップデート

私はrvm-capistranoを使用しており、作成したユーザーを使用してすべてをインストールしましたが、デプロイ時に別のエラーが発生しました:cold:

「if [ -d /home/app/riffbox/shared/cached-copy ]; then cd /home/app/riffbox/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && を実行」 git reset -q --hard 2afbd8fb661f62a01e0940be38e70915fc3e32ea && git clean -q -d -x -f; そうでなければ git clone -q git@bitbucket.org:xxx/iv.git /home/app/riffbox/shared/cached-copy && cd /home/app/riffbox/shared/cached-copy && git checkout -q -b deploy 2afbd8fb661f62a01e0940be38e70915fc3e32ea; fi"
サーバー: ["198.199.74.146"]
パスワード:
[198.199.74.146] コマンドの実行
** [198.199.74.146 ::エラー]致命的: ' https://xxx@bitbucket.org 'のパスワードを読み取れませんでした:そのようなデバイスまたはアドレスはありません
パスワード:
コマンドは 7399ms で終了しました
git checkout -q -b deploy 2afbd8fb661f62a01e0940be38e70915fc3e32ea; fi'" on 198.199.74.146




4

1 に答える 1

0

rvm-capistrano gemを使用する必要があります。デプロイ中に RVM 環境にアクセスできるようになります。


非常に重要な注意:

展開にユーザーを使用しています。ユーザーrootを直接使用するのは全体的に悪い習慣rootです。アプリケーションごとに新しいユーザーを使用することを検討する必要があります。

于 2013-04-13T17:54:19.067 に答える