2017-11-14 18 views
1

오늘 (왜 그런지 모르겠다 !!!!) 저는 카피 스트라 노와 함께 프로젝트를 전개 할 수 없습니다. NoMethodError : 정의되지 않은 메소드`start_with? '

나는이 작업을

namespace :deploy do 

    # Theme path 
    set :theme_path, Pathname.new('web/app/themes').join(fetch(:theme_name)) 

    # Local Paths 
    set :local_theme_path, Pathname.new(File.dirname(__FILE__)).join('../').join(fetch(:theme_path)) 
    set :local_dist_path, fetch(:local_theme_path).join('dist') 

    task :compile do 
    run_locally do 
     within fetch(:local_theme_path) do 
     execute "git checkout #{fetch(:branch)}" 
     execute :gulp, '--production' 
     end 
    end 
    end 

    task :copy do 
    on roles(:web) do 

     # Remote Paths (Lazy-load until actual deploy) 
     set :remote_dist_path, -> { release_path.join(fetch(:theme_path)).join('dist') } 

     info " Your local distribution path: #{fetch(:local_dist_path)} " 
     info " Boom!!! Your remote distribution path: #{fetch(:remote_dist_path)} " 
     info " Uploading files to remote " 
     upload! fetch(:local_dist_path).to_s, fetch(:remote_dist_path), recursive: true 
    end 
    end 

    task assets: %w(compile copy) 
end 

카피 스트라 노 인쇄이 오류

(Backtrace restricted to imported tasks)

cap aborted!

SSHKit::Runner::ExecuteError: Exception while executing as ec2->[email protected]*********: undefined method `start_with?' for #Pathname:0x0000*fc***a****

Caused by:

NoMethodError: undefined method `start_with?' for #Pathname:0x0000*fc***a****

를 시작

나는 모든 시도 : 등 제거 노드, 루비, ... 엄마 아무것도 변화. 누군가 나를 도울 수 있습니까?

감사

+0

가 최근에 어떤 바꾼 거니? 뭔가 경로와 관련이 있습니다. –

+0

내 서버에서 루비 -v = 루비 2.0.0p648 (2015-12-16) [x86_64-linux] – mikmprdd

+0

"보석 업데이트"만 수행 ... – mikmprdd

답변

3
upload! fetch(:local_dist_path).to_s, fetch(:remote_dist_path), recursive: true 

이어야

upload! fetch(:local_dist_path).to_s, fetch(:remote_dist_path).to_s, recursive: true 

(모두 Pathname들에 to_s를 호출합니다.)

+0

예! 그것은 작동합니다! 어제까지 모든 것이 그것 없이는 작동했습니다! – mikmprdd

+0

사용하고있는 보석 중 하나의 버그/문제로 인해 잘못된 코드가 작동했습니다. 최신 버전이 아닙니다. 그래서? 경로명이 아닌 문자열을 기대합니다. 기간. – mudasobwa

+0

이 오류는 sshkit 1.15.0 (Capistrano에서 사용하는 보석)에 도입 된 버그로 인한 것입니다. 다음 릴리스에서 수정 될 예정입니다. 그 동안 'to_s'해결 방법은 완벽하게 유효합니다. https://github.com/capistrano/sshkit/issues/409 –