require in capistrano deploy.rb cannot find file

前端 未结 2 2091
清酒与你
清酒与你 2021-02-09 04:55

I have a rails 3.0.5 app and I\'m setting up capistrano to use a recipe.

in my config directory I have a file named \"database_capistrano.rb\" and in my deploy.rb, also

2条回答
  •  臣服心动
    2021-02-09 05:15

    Ok, I manage to find out how this should be done.

    Just copied the file to a new sub-directory "deploy", for organization only, and at the beginning of my deploy.rb, added:

    $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'deploy')
    

    Then, in deploy.rb, just used:

    require 'database_capistrano'
    

提交回复
热议问题