Permalink
Browse files

Trying to rescue ActiveRecord connection

  • Loading branch information...
1 parent 46cf491 commit 44c2b7388b7cb5968b3430458c8b36a997bf9ccb @ddemaree committed Nov 6, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 config/environment.rb
View
@@ -9,8 +9,12 @@
$:<< File.join( APP_ROOT )
$:<< File.join( APP_ROOT, "lib" )
-require 'active_record'
-dbconfig = YAML.load(ERB.new(File.read('config/database.yml')).result)
-ActiveRecord::Base.establish_connection dbconfig[ENV['RACK_ENV']]
+begin
+ require 'active_record'
+ dbconfig = YAML.load(ERB.new(File.read('config/database.yml')).result)
+ ActiveRecord::Base.establish_connection dbconfig[ENV['RACK_ENV']]
+rescue => e
+ puts "Could not establish ActiveRecord connection: #{e}"
+end
require "thirty_one"

0 comments on commit 44c2b73

Please sign in to comment.