3

Rails Cast エピソード 335 をフォローしています: http://railscasts.com/episodes/335-deploying-to-a-vps

Linode VPN を使用して、

ランニング:

cap deploy:cold

* executing `deploy:cold'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@github.com:benamir/listpro.git master"
    command finished in 1546ms
  * executing "if [ -d /home/deployer/apps/listpro/shared/cached-copy ]; then cd /home/deployer/apps/listpro/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 84770c5b6f38dbfeca1b5ef619fb1b9940121a4e && git clean -q -d -x -f; else git clone -q git@github.com:benamir/listpro.git /home/deployer/apps/listpro/shared/cached-copy && cd /home/deployer/apps/listpro/shared/cached-copy && git checkout -q -b deploy 84770c5b6f38dbfeca1b5ef619fb1b9940121a4e; fi"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 2874ms
    copying the cached version to /home/deployer/apps/listpro/releases/20121012050310
  * executing "cp -RPp /home/deployer/apps/listpro/shared/cached-copy /home/deployer/apps/listpro/releases/20121012050310 && (echo 84770c5b6f38dbfeca1b5ef619fb1b9940121a4e > /home/deployer/apps/listpro/releases/20121012050310/REVISION)"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 8648ms
  * executing `deploy:finalize_update'
    triggering before callbacks for `deploy:finalize_update'
  * executing `deploy:assets:symlink'
  * executing "rm -rf /home/deployer/apps/listpro/releases/20121012050310/public/assets &&\\\n        mkdir -p /home/deployer/apps/listpro/releases/20121012050310/public &&\\\n        mkdir -p /home/deployer/apps/listpro/shared/assets &&\\\n        ln -s /home/deployer/apps/listpro/shared/assets /home/deployer/apps/listpro/releases/20121012050310/public/assets"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 246ms
  * executing "chmod -R g+w /home/deployer/apps/listpro/releases/20121012050310"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 878ms
  * executing "rm -rf /home/deployer/apps/listpro/releases/20121012050310/public/system && mkdir -p /home/deployer/apps/listpro/releases/20121012050310/public/"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 99ms
  * executing "ln -s /home/deployer/apps/listpro/shared/system /home/deployer/apps/listpro/releases/20121012050310/public/system"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 96ms
  * executing "rm -rf /home/deployer/apps/listpro/releases/20121012050310/log"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 95ms
  * executing "ln -s /home/deployer/apps/listpro/shared/log /home/deployer/apps/listpro/releases/20121012050310/log"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 95ms
  * executing "rm -rf /home/deployer/apps/listpro/releases/20121012050310/tmp/pids && mkdir -p /home/deployer/apps/listpro/releases/20121012050310/tmp/"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 99ms
  * executing "ln -s /home/deployer/apps/listpro/shared/pids /home/deployer/apps/listpro/releases/20121012050310/tmp/pids"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 95ms
    triggering after callbacks for `deploy:finalize_update'
  * executing `bundle:install'
  * executing "ls -x /home/deployer/apps/listpro/releases"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 132ms
  * executing "cd /home/deployer/apps/listpro/releases/20121012050310 && bundle install --gemfile /home/deployer/apps/listpro/releases/20121012050310/Gemfile --path /home/deployer/apps/listpro/shared/bundle --deployment --quiet --without development test"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
 ** [out :: 198.74.59.184] sh: bundle: not found
    command finished in 95ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deployer/apps/listpro/releases/20121012050310; true"
    servers: ["198.74.59.184"]
    [198.74.59.184] executing command
    command finished in 868ms
failed: "sh -c 'cd /home/deployer/apps/listpro/releases/20121012050310 && bundle install --gemfile /home/deployer/apps/listpro/releases/20121012050310/Gemfile --path /home/deployer/apps/listpro/shared/bundle --deployment --quiet --without development test'" on 198.74.59.184
[listpro-a(__git_ps1 " (%s)")]$ 

申し訳ありませんが、後戻りする必要があります...

rbenv インストーラーを実行した後:

 curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash

私は得る

 Seems you still have not added 'rbenv' to the load path:

export RBENV_ROOT="${HOME}/.rbenv"

if [ -d "${RBENV_ROOT}" ]; then
   export PATH="${RBENV_ROOT}/bin:${PATH}"
   eval "$(rbenv init -)"
fi

上記はすでに .bashrc ファイルに保存されています

昨日:これらのコマンドをすべて実行するとうまくいきました:

しかし、cap deploy の後、rbenv はもうパスにありません。

  rbenv: command not found

エコー $PATH:

 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
4

3 に答える 3

4

問題は、capistrano の実行時に .profile がロードされないため、手動で rbenv をロードする必要があることです。

deploy.rbこれをファイルに追加します。

set :default_environment, {
  'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}

それで十分なはずです。

注:サーバーで Ubuntu Precise Pangolin を使用しています。

于 2013-04-03T16:12:03.580 に答える
0

の原因:

  * executing "cd /home/deployer/apps/listpro/releases/20121012050310 && bundle install --gemfile /home/deployer/apps/listpro/releases/20121012050310/Gemfile --path /home/deployer/apps/listpro/shared/bundle --deployment --quiet --without development test"
servers: ["198.74.59.184"]
[198.74.59.184] executing command
** [out :: 198.74.59.184] sh: bundle: not found

バンドラーがインストールされていないようです。sshして実行してみてください:

gem install bundler

多分これは役立つでしょう。より多くの情報を提供しない場合、私はそれであなたを助けるかもしれません。

于 2012-10-12T12:51:51.670 に答える
0

サーバーにログインし、最新リリースに cd してバンドル インストールを試み、どのようなエラーが発生するかを確認します

于 2012-10-12T07:44:34.890 に答える