Can't get rails app to run on hero

I am trying to deploy a rails application for heroku but keep getting the following error. I would think that managing postgres gems would be a bit of a hero.

I have tried everything that I can imagine without installing postgres on my local machine, which I will need to do if I want to install the postgres stone. There is also no pearl called activerecord-postgresql-adapter ... I assume this is a standard adapter that comes with rails ??

Any thoughts on how to fix this?

 App failed to start /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (no such file to load -- pg) (RuntimeError) from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:438:in `initialize_database' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:141:in `process' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send' from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run' from /disk1/home/slugs/135415_c7f31f0_9f1f/mnt/config/environment.rb:9 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' ... 14 levels... from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize' from /home/heroku_rack/heroku.ru:1:in `new' from /home/heroku_rack/heroku.ru:1 
+4
source share
4 answers

Turns out this is a bug due to different bundler versions running on heroku and my machine. I switched to the .gems dependency file and everything seems to work.

+1
source

Upgrade your Gemfile to Bundler 0.9 and add the pg gem. Easy as that.

+7
source

Details on Heroku package support are here: http://docs.heroku.com/bundler

Geroku is required to indicate the pearl 'pg'.

+1
source

Wow, I worked too long on the same.

I realized that I used gem 'ps' instead of 'pg'

> <.

stupid postres gem!

0
source

Source: https://habr.com/ru/post/1301910/


All Articles