Capistrano no such file to load — deploy

后端 未结 6 2093
感情败类
感情败类 2021-01-05 03:37

When I try to run any cap commands, I get a "no such file to load -- deploy" error.

Here is the output:

Tylers-MacBook-Pro:cap_a         


        
相关标签:
6条回答
  • 2021-01-05 03:57

    I had this problem today, it was due to me having capistrano 3.* installed and this thread provided the solution that worked for me:

    Rails 4, Capistrano 3.0.0, cannot load such file -- deploy

    0 讨论(0)
  • 2021-01-05 04:00

    Here's my Capfile -- try it since you're on capistrano 2

    load 'deploy' if respond_to?(:namespace) # cap2 differentiator
    
    # Uncomment if you are using Rails' asset pipeline
    # load 'deploy/assets'
    
    Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
    
    load 'config/deploy' # remove this line to skip loading any of the default tasks
    
    0 讨论(0)
  • 2021-01-05 04:16

    Try:

    load 'deploy'
    

    (Assuming you're using capistrano 2).

    Our capfile looks like this:

    load 'deploy' if respond_to?(:namespace) # cap2 differentiator
    
    # Uncomment if you are using Rails' asset pipeline
    # load 'deploy/assets'
    
    Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
    
    load 'config/deploy' # remove this line to skip loading any of the default tasks
    
    0 讨论(0)
  • 2021-01-05 04:18

    So I ran into this same error. My mistake was is after installing the gem files I skipped the install steps and instead had used old 2.x version examples for my Capfile and deploy files...

    So after doing bundle install try using the command cap install STAGES=sandbox,qa,production, or whichever stages you need. After that it should overwrite your files. Go edit the files it added and you should be good to go.

    0 讨论(0)
  • 2021-01-05 04:20

    Downgrade your capistrano to the previous version 2.9.0.

    The newest one (2.11.0) causes the problem you mentioned.

    0 讨论(0)
  • 2021-01-05 04:22

    I've just had this problem today.

    The problem was caused by not specifying the cap gem version, and running bundle update, which updated cap to 3.* .

    After following the advice here, I still had the same problem. However, after checking the output carefully, I noticed that the error was coming from cap 3.* not being able to load deploy.

    This was strange, because I had then set the cap gem version to ~> 2, still had the error coming from cap 3.* . Did the same to downgrade the cap version to ~> 1, and again the error was still coming from cap 3.* .

    It was fixed by removing cap 3.* from my gemset completely.

    I was under the impression that I could have multiple gem versions installed, and as long as the version I wanted to use was specified in the Gemfile, then that would be the version used. I still have a couple of cap 2.* s installed although my Gemfile specifies ~> 1, the version 2 gems don't seem to impact, but having version 3.* installed too, causes me to have the problem described above by the OP.

    Hope this might help someone else.

    Paul

    0 讨论(0)
提交回复
热议问题