Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

require in capistrano deploy.rb cannot find file

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 in config directory, I have the following line, just in the beginning:

require 'database_capistrano'

But I'm getting:

`require': no such file to load -- capistrano_database (LoadError)

Also try with:

require 'database_capistrano.rb'

And don't work...

How, in Rails 3.0.5, include files in capistrano deploy.rb??

like image 556
Joao Pereira Avatar asked Mar 20 '11 00:03

Joao Pereira


1 Answers

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'
like image 181
Joao Pereira Avatar answered Sep 19 '22 20:09

Joao Pereira