2011-11-12 5 views
0

MoonshineとCapistranoを使用して新しいサーバーを設定する際に問題があります。かなりよく始めるように思わUbuntuのパッケージの束をインストールし、REEをコンパイルし、いくつかの宝石をインストールされますが、それはこの出力とSFTP経由でファイルをアップロードするために失敗します。そのエラーをグーグルで配布時にMoonshine/CapistranoがSFTPに問題があるのはなぜですか?

* executing `moonshine:setup_directories' 
    * executing "mkdir /tmp/moonshine" 
    servers: ["myserver.tld"] 
    [myserver.tld] executing command 
    command finished 
    servers: ["myserver.tld"] 
** sftp upload /Users/arussell/Sites/mysite/config/moonshine/production.yml -> /tmp/moonshine/production.yml 
/Users/arussell/.rvm/gems/ree-1.8.7-2011.03/gems/capistrano-2.5.19/lib/capistrano/transfer.rb:196:in `normalize': undefined method `pos' for #<Pathname:0x10f3a6988> (NoMethodError) 
    from /Users/arussell/.rvm/gems/ree-1.8.7-2011.03/gems/capistrano-2.5.19/lib/capistrano/transfer.rb:104:in `prepare_transfers' 

は本当にないです私が理解できるのは、capistrano/transfer.rbが196行目のPathNameオブジェクト以外のものを期待しているということですが、それが何を期待しているのか分からず、なぜPathNameオブジェクトが与えられているのかわかりません。


編集:ここには私deploy.rbです:

set :stages, %w(staging production dev) 
set :default_stage, "staging" 
require 'capistrano/ext/multistage' rescue "YOU NEED TO INSTALL THE capistrano-ext GEM" 
require 'fileutils' 

if ENV['branch'] 
    set :branch, ENV['branch'] 
end 

set :deploy_via, :remote_cache 

before "deploy:restart", "deploy:delete_cache" 

namespace(:deploy) do 
    desc "delete cache" 
    task :delete_cache do 
    run "rm -rf /usr/local/shared/cache/" 
    end 
    task :null, :roles => :app do 
    run "date" 
    end 
end 
require './config/boot' 

...と私のデプロイ/ production.rb:

server "myserver.tld", :app, :web, :db, :primary => true 

set :rails_env, 'production' 

編集2:私はSFTPの代わりにSCPを使用しようとしましたが、それはうまくいきませんでした。

upload "local", "remote", :via => :scp 
download "remote", "local", :via => :scp 

をして展開しようとしたときに、代わりにこのエラーを得た:私は私のデプロイ/ production.rbにこれを追加

upload via scp failed on myserver.tld: SCP did not finish successfully() (SCP did not finish successfully()) 

答えて

0

これは、Moonshineがcap production deploy:setupの間に展開ステージ固有のファイル(例:config/moonshine/production.yml)の存在を処理できないことが原因であることが判明しました。

ここで私はそれを回避得た方法は次のとおりです。

  • config/moonshine/production.ymlを取り外します(あなたのデプロイ段階が呼ばれているものでproductionを置き換える)
  • 実行cap production deploy:setup
  • cap production deploy
を実行し、再度
  • config/moonshine/production.ymlを入れて
  • 0

    を私はどちらか、そのエラーを把握することはできません。あなたの使用しているカピストラノのバージョンは、1年プラスかなり古いですが表示されます。使用しているバージョンを最新のリリースに更新して、もう一度お試しください。

    それでも問題が解決しない場合は、deploy.rb設定のサニタイズ済みコピーを提供すると役立ちます。

    +0

    Capistranoを2.9にアップデートしても、いいキャッチです。 0は役に立ちませんでした:私はまだ同じエラーが表示されます。 config/deploy.rbとconfig/deploy/production.rbのサニタイズ版を追加する質問を編集しました。 –

    関連する問題