ボックスで実行中のアプリがあり、そのボックスに別のアプリを追加しようとしています。
どちらも RVM を使用しています。
問題は、ボックスに追加した新しいアプリのデプロイ プロセスが失敗することです。
展開するとき、私は呼び出します
RVM info
私が使っているルビーを見るために。出力は次のとおりです。
ruby-1.9.3-p392:
system:
uname: "Linux li83-41 2.6.39.1-linode34 #1 SMP Tue Jun 21 10:29:24 EDT 2011 i686 GNU/Linux"
system: "ubuntu/10.04/i386"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.22.3 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
updated: "4 days 21 hours 14 minutes 38 seconds ago"
path: "/usr/local/rvm"
ruby:
interpreter: "ruby"
version: "1.9.3p392"
date: "2013-02-22"
platform: "i686-linux"
patchlevel: "2013-02-22 revision 39386"
full_version: "ruby 1.9.3p392 (2013-02-22 revision 39386) [i686-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-1.9.3-p392"
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p392"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/gem"
rake: "/usr/local/rvm/gems/ruby-1.9.3-p392/bin/rake"
environment:
PATH: "/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.3-p392"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.3-p392:/usr/local/rvm/gems/ruby-1.9.3-p392@global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p392"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.3-p392/.irbrc"
RUBYOPT: ""
gemset: ""
デプロイ中に失敗するバンドラーを使用しています:
cd #{current_path} && bundle install --deployment
このエラーを投げる:
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.1.0)
Installing i18n (0.6.5)
Installing minitest (4.7.5)
Installing multi_json (1.7.9)
Installing atomic (1.1.13)
Installing thread_safe (0.1.2)
Installing tzinfo (0.3.37)
Installing activesupport (4.0.0)
Gem::InstallError: activesupport requires Ruby version >= 1.9.3.
An error occurred while installing activesupport (4.0.0), and Bundler cannot
continue.
Make sure that `gem install activesupport -v '4.0.0'` succeeds before bundling.
rake aborted!
私はここで機知に富んでいます: ruby1.9.3-p392 を使用しているように見えますが、バンドラーは ruby >= 1.9.3 が必要だと言っています。
これが私の .bundle/config です:
---
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_FROZEN: '1'
また、ボックスに ssh すると、正しいルビーを使用しているように見えます。
$ which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
そして、bundle install を実行すると正常に動作します。
何か案は?
編集#1
私は Vlad を使用しています。ここに deploy.rb があります。
set :repository, repo_location
set :revisions, 5
set :revision, "HEAD"
set :domain, domain
set :user, login_user
set :deploy_to, deploy_dir
set :deploy_env, "production"
namespace :vlad do
desc 'Restart Passenger'
remote_task :restart_app do
puts "Restarting passenger..."
run "touch #{current_release}/tmp/restart.txt"
end
desc 'Runs our full deployment'
task :deploy => ['vlad:update',
'vlad:symlink',
'vlad:rvm_info',
'vlad:update_bundle',
'vlad:migrate_database',
'vlad:cleanup',
'vlad:restart_app']
desc 'Symlinks your custom directories'
remote_task :symlink do
run "ln -s #{shared_path}/environments #{latest_release}/config/environments"
run "ln -s #{shared_path}/database.yml #{current_path}/config/database.yml"
run "ln -s #{shared_path}/config.yml #{current_path}/config/config.yml"
end
desc 'Show RVM Info for debug purposes'
remote_task :rvm_info do
run "cd #{current_path} && rvm info"
end
desc 'Update the Bundler bundle we use to include any new gems in the Gemfile'
remote_task :update_bundle do
run "cd #{current_path} && bundle install --deployment"
end
# copied from the vlad source, integrate migrate does not work as it's missing
# the && between the cd and the db migrate task itself. bug is already tracked
# at http://rubyforge.org/tracker/?group_id=4213&atid=16258&func=detail&aid=28445,
# but currently does not do anything.
remote_task :migrate, :roles => :app do
break unless target_host == Rake::RemoteTask.hosts_for(:app).first
directory = case migrate_target.to_sym
when :current then current_path
when :latest then latest_release
else raise(ArgumentError, "unknown migration target #{migrate_target.inspect}")
end
run(["cd #{directory}",
"bundle exec #{rake_cmd} db:migrate #{migrate_args} RAILS_ENV=#{rails_env}"].join(" && "))
end
end