1

I'm follow an online railstutorial. I'm a newbie, and now I finished just my second app. It works ok on a local machine, but I have a problem with heroku. I pushing my app successfully, and then I done heroku rake db:migrate But I see this error on my page

An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details

And I see this warning in command line:

rake aborted! Please install the postgresql adapter: gem install activerecord-postgresql-adap ter (pg is not part of the bundle. Add it to Gemfile.)

I google this error and found that I need add this strings to my gemfile:

gem 'sqlite3', :group => :development gem 'pg', :group => :production

Done it, and retried, but nothing changed, and I still have this in my command line

Please install the postgresql adapter: gem install activerecord-postgresql-adap ter (pg is not part of the bundle. Add it to Gemfile.)

I can't understand it, cause I defenitely had pg gem, and I can see his installation on my local machine

Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using jquery-rails (2.0.2)
Using pg (0.13.2)
Using rails (3.2.1)
Using sass (3.1.16)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.2.4)

but I can't see the same, when bundle installing on heroku server

 Installing thor (0.14.6)
  Installing railties (3.2.1)
  Installing coffee-rails (3.2.2)
  Installing jquery-rails (2.0.2)
  Using bundler (1.0.7)
  Installing rails (3.2.1)
  Installing sass (3.1.16)
  Installing sass-rails (3.2.5)
  Installing uglifier (1.2.4)

How can I solve it? Really have no idea. Please help me.

btw, sorry for my english, I'm from russia)

update: yeah, i see that it runs bundle install --without development, but my gemfile now looks like:

group :production do
  gem 'pg'
end
group :development, :test do
   gem 'sqlite3-ruby', :require => 'sqlite3'
end

as you can see, 'pg' is definitely out of development group, but heroku didn't install it

alexmatlin
  • 11
  • 2

2 Answers2

0

Looks like you added the pg gem to the development group in your Gemfile - when Heroku deploys, it runs bundle install --without development, meaning that it'll not install gems in that group. Move the gem outside of the development group.

redhotvengeance
  • 27,446
  • 10
  • 49
  • 54
0

If you've updated your Gemfile make sure you commit it and the Gemfile.lock to git and then repush your application to Heroku.

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