Rails 3.2.2は、自分の開発環境と私のサーバーの両方で正常に動作しています。なぜ私のサーバーに3.2.3のインストールバンドルをバンドルしないのですか?
私は変更することで、3.2.3にアップグレードしようとしている:
gem 'rails', '3.2.2'
を
gem 'rails', '3.2.3'
に、次に実行する:
bundle update
bundle
を私が展開しようとするまで、すべてがうまくいきます私のサーバーに。デプロイ時には、私はこのメッセージが表示されます。
An error occured while installing railties (3.2.3), and Bundler cannot continue.
Make sure that `gem install railties -v '3.2.3'` succeeds before bundling.
私は、サーバーにログインし、宝石railties -v「3.2.3」をインストールし、コマンドを実行し、それが問題なく動作しています。しかし、デプロイメントは常に同じ方法で失敗します。
hereのようにキャッシュディレクトリを削除しようとしましたが、正しく動作しているかどうかはわかりません。私はサーバーと私の開発環境でrvmを使用しています。
誰でも助けてくれますか?
require "bundler/capistrano"
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :application, "teamsite"
set :repository, "[email protected]:user/teamsite.git"
set :deploy_to, "/home/website.com/rails/application/"
set :user, "website.com"
set :scm, :git
set :use_sudo, false
default_run_options[:pty] = true
set :branch, "master"
set :scm_verbose, true
set :deploy_via, :remote_cache
ssh_options[:forward_agent] = true
task :staging do
role :web, "staging.website.com"
role :app, "staging.website.com"
role :db, "staging.website.com", :primary => true
end
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
end
end
namespace :customs do
task :create_symlink, :roles => :app do
run <<-CMD
ln -nfs #{shared_path}/files #{release_path}/files
CMD
run <<-CMD
ln -nfs #{shared_path}/drawings #{release_path}/drawings
CMD
run <<-CMD
ln -nfs #{shared_path}/photos #{release_path}/photos
CMD
end
end
after "deploy:create_symlink","customs:create_symlink"
after "deploy", "deploy:cleanup"
更新
私は最終的に別のユーザーに展開することによってこの問題を解決することができました:
は、ここに私のdeploy.rbファイルです。しかし、問題はまだ残っています。古いユーザーのためにどのように宝石のキャッシュをクリアするのですか?
スクリプトをお願いします – mpapis