デプロイを処理するために whiskey_disk を使用しています。これは whiskey_disk の問題ではありませんが、git からプロジェクトの宛先ディレクトリへのクローン作成が完了した後、デプロイ後のスクリプトを実行します。私が展開しようとしているスクリプトは、 a を呼び出すことでbundle install
あり、次のようになります。
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
export PATH=/home/ec2-user/.rvm/gems/ruby-2.0.0-p247/bin:/home/ec2-user/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/bin:/home/ec2-user/.rvm/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin
echo "["`hostname`"] Installing the bundle..."
bundle install --binstubs --local --path ../shared/bundle --deployment --without development test console replication|grep -vi using
上記で明確に設定されているにもかかわらず、それは失敗し、bundle
またはを見つけることができません。rake
$PATH
/home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'bundler' (>= 0) among 90 total gem(s) (Gem::LoadError)
from /home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247@global/bin/bundle:22:in `<main>'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
/home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rake' (>= 0) among 90 total gem(s) (Gem::LoadError)
from /home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /home/ec2-user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247@global/bin/rake:22:in `<main>'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
from /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
スクリプトの冒頭で上記の環境を正常に初期化したと思い、さらにPATHを設定することで、インタラクティブシェルで正常に表示されることがわかりました。
[ec2-user@ip-1 ~]$ which bundle
~/.rvm/gems/ruby-2.0.0-p247@global/bin/bundle
[ec2-user@ip-1 ~]$ which rake
~/.rvm/gems/ruby-2.0.0-p247@global/bin/rake
他に何が問題になる可能性があるかについて何か提案はありますか?