ruby on rails - Failing to push to heroku -


i attempting push rails 3.2.12 app heroku, configured postgres database. first time ran git push heroku master received below error.

running: rake assets:precompile rake aborted! not connect server: connection refused server running on host "127.0.0.1" , accepting tcp/ip connections on port 5432? 

after troubleshooting came across this post , put following line in config/application.rb file:

config.assets.initialize_on_precompile = false 

i ran heroku run rake db:migrate begin populating heroku database , received following error:

running rake db:create attached terminal... up, run.4115 rake aborted! undefined local variable or method `config' main:object /app/config/application.rb:5:in `<top (required)>' /app/rakefile:5:in `require' /app/rakefile:5:in `<top (required)>' 

funny enough, line 5 of application.rb previous line added:

config.assets.initialize_on_precompile = false 

lastly, noticed can't start database locally above line in application.rb file - receive following error:

config/application.rb:5:in `<top (required)>': undefined local variable or method `config' main:object (nameerror) 

this issue seems catch 22. how can deploy heroku without altering application.rb file run on local server?

make sure config.assets.initialize_on_precompile = false in correct place this:

module yourapplicationname   class application < rails::application      config.assets.initialize_on_precompile = false 

make sure restart everything.

also, if above doesn't work, temporary work around change gemfile to:

group :development, :test   gem 'sqlite3' end  group :production   gem 'pg' end 

then run bundle install --without production

heroku not recommend using different database development , production. work , have used many times , running


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -