Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
managing database.yml securely - no such file to load "deploy/capistrano_database"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
treydock  
View profile  
 More options Jan 30, 4:43 pm
From: treydock <treyd...@gmail.com>
Date: Mon, 30 Jan 2012 13:43:16 -0800 (PST)
Local: Mon, Jan 30 2012 4:43 pm
Subject: managing database.yml securely - no such file to load "deploy/capistrano_database"
I'm attempting use of Capistrano for the first time, and have followed
the steps on the wiki to "Manage database.yml securely".

I've put both database.yml.erb and capistrano_database.rb into
multiple locations, all with the same results.  I've tried config/
deploy/ and now deploy/

This is the error
-------------
cap deploy:setup
/home/trey/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/
rubygems/custom_require.rb:36:in `require': no such file to load --
deploy/capistrano_database (LoadError)

Here's my config/deploy.rb
----------

#############################################################
##   Application
##############################################################
set :application, "ballotbox"

#############################################################
##   Settings
##############################################################
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'deploy')
require "deploy/capistrano_database"

$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib
directory to the load path.
require "rvm/capistrano"                  # Load RVM's capistrano
plugin.
set :rvm_ruby_string, 'ruby-1.9.2-p290@ballotbox'        # Or whatever
env you want it to run in.

require "bundler/capistrano"

set :use_sudo, false

#############################################################
##   Servers
##############################################################
set :user, "ballotbox"

set :deploy_to, "/usr/share/#{application}"

set :domain, "liberalartsvoting.tamu.edu"
role :web, domain
role :app, domain
role :db, domain, :primary => true

#############################################################
##   Git
##############################################################
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`,
`perforce`, `subversion` or `none`
set :scm, :git
set :repository,  "g...@cllawolf.tamu.edu:ballotbox.git"
set :branch, "master"

#############################################################
##   Passenger
##############################################################
namespace :passenger do
  desc "Restart Application"
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

after :deploy, "passenger:restart"

The "$LOAD_PATH" was an attempt to force the deploy/ directory to be
loaded.  My Capfile looks like this...

$ cat Capfile
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

Thanks
- Trey


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Richardson  
View profile  
 More options Feb 3, 4:26 pm
From: Michael Richardson <m...@sandelman.ca>
Date: Fri, 03 Feb 2012 16:26:07 -0500
Local: Fri, Feb 3 2012 4:26 pm
Subject: Re: [capistrano] managing database.yml securely - no such file to load "deploy/capistrano_database"

>>>>> "treydock" == treydock  <treyd...@gmail.com> writes:

    treydock> I'm attempting use of Capistrano for the first time, and
    treydock> have followed the steps on the wiki to "Manage
    treydock> database.yml securely".

I'm not really sure what you are trying to do.

This is what I do.  Put database.yml and production.rb (because I have
some settings that differ depending on which machine, alpha test or
release) into ~ on the target machine(s).  
(I often put those files there by debian package and/or post-install
script), and I do:

namespace :deploy do
  task :update_database_yml, :roles => [:app,:web] do
    db_config = "/home/#{user}/database.yml"
    prod_config = "/home/#{user}/production.rb"
    run "cp #{db_config}   #{release_path}/config/database.yml"
    run "cp #{prod_config} #{release_path}/config/environments"
    releasenum=File.basename(release_path)
    run "echo '$ReleaseNum = \"#{releasenum}\"' >#{release_path}/config/initializers/releasenum.rb"
    puts "Ran update database_yml"
  end
  after "deploy:update_code", "deploy:update_database_yml"
end

(Releasenum.rb is included in my layout as a comment, so I can know that
in fact I did deploy properly...)

--
]       He who is tired of Weird Al is tired of life!           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] m...@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
   Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE>
                       then sign the petition.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
treydock  
View profile  
 More options Feb 7, 11:41 pm
From: treydock <treyd...@gmail.com>
Date: Tue, 7 Feb 2012 20:41:23 -0800 (PST)
Local: Tues, Feb 7 2012 11:41 pm
Subject: Re: managing database.yml securely - no such file to load "deploy/capistrano_database"
I ended up getting it working.  What I was working towards was having
capistrano prompt me during setup for the production db password that
way I can push an erb templated database.yml to production without
storing any passwords.

This is what fixed my issue,

On Feb 3, 3:26 pm, Michael Richardson <m...@sandelman.ca> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
treydock  
View profile  
 More options Feb 7, 11:42 pm
From: treydock <treyd...@gmail.com>
Date: Tue, 7 Feb 2012 20:42:47 -0800 (PST)
Local: Tues, Feb 7 2012 11:42 pm
Subject: Re: managing database.yml securely - no such file to load "deploy/capistrano_database"
And accidently hit send,...

Capfile - added these 2 lines to end of it to load
-------------
$:.unshift File.join(File.dirname(__FILE__), 'config/deploy')
require "capistrano_database_yml"

On Feb 7, 10:41 pm, treydock <treyd...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »