1

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ファイルです。しかし、問題はまだ残っています。古いユーザーのためにどのように宝石のキャッシュをクリアするのですか?

+0

スクリプトをお願いします – mpapis

答えて

3

あなたは、最初からすべての宝石を再インストールする

gem pristine --all --no-extensions 

を使用することができます。ホスト上で乗客を使用している場合は、その宝石キャッシュディレクトリが実際にどこにあるかを調べる必要があります。

export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8" 

それとも、あなたのサーバー上でRVMを使用している場合は、そのパスを使用している現在のバージョンRVMに思われる:GEM_PATH値の.bashrcのを見て、Dreamhostの上の鉱山があります。

関連する問題