2

I'm trying to deploy an application to Heroku after upgrading to Rails 3.1 with the asset pipeline. I ran into the common issue mentioned on Heroku's troubleshooting page when receiving the error:

could not connect to server: Connection refused 
Is the server running on host "127.0.0.1" and accepting 
TCP/IP connections on port xxxx?

I took the suggestions on the page and added the following to my config/application.rb file (after also trying to add it to the individual [environment].rb files to no effect)

config.assets.initialize_on_precompile = false

I've modified my database.yml file to point my production environment to a non-existant database, but when running the assets:precompile task locally, I get the following:

> RAILS_ENV=production bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake aborted!
FATAL:  database "my_nonexistant_database" does not exist

Tasks: TOP => environment
(See full trace by running task with --trace)

I'm trying to figure out what part of my application is trying to initialize the database so that I can fix it, but I've run out of ideas for getting more debugging information than this.

Anyone have any tips for either getting more information about where my app is trying to init the DB, or for fixing the underlying problem?

Bryan Marble
  • 3,467
  • 5
  • 26
  • 29

1 Answers1

1

You should try the new labs feature http://devcenter.heroku.com/articles/labs-user-env-compile which will make variables available at slug compile time.

John Beynon
  • 37,398
  • 8
  • 88
  • 97