0

Sorry, I'm new in Ruby on Rails and I'm following a tutorial, but I'm getting troubles trying to push the database to heroku. I already installed postgresql in my Linux, tryed a lot of tutorials.

When I enter heroku rake db:migrate, I get this error message :

DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or >fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the >release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2->has-been-released. (called from at /app/Rakefile:7) rake aborted! Please install the postgresql adapter: gem install activerecord-postgresql-adapter (pg is >not part of the bundle. Add it to Gemfile.)

Tasks: TOP => db:migrate => db:load_config (See full trace by running task with --trace)

My Gemfile is this:

source 'https://rubygems.org'
gem 'rails', '3.2.2'
gem 'sqlite3'

group :production do
   gem 'pg'
end

group :assets do
gem 'sass-rails',   '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
Aklovo
  • 97
  • 1
  • 5

2 Answers2

3

As mentioned in the error, you will need to install the postgresql-adapter

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

Install it with gem install activerecord-postgresql-adapter. You should also add gem 'pg'to your Gemfile and run bundle install.


As mentioned here, take a look at your database.yml file to check if you wrote "postgres" instead of "postgresql".

Community
  • 1
  • 1
Justin D.
  • 4,946
  • 5
  • 36
  • 69
  • I tried already it say this: ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository ERROR: Possible alternatives: activerecord-jdbcpostgresql-adapter, activerecord-postgis-adapter, activerecord-jdbcmssql-adapter, activerecord-jdbcmysql-adapter, activerecord-postgresql-cursors – Aklovo Mar 31 '12 at 03:36
  • I updated my answer. I put the solution under the line. – Justin D. Mar 31 '12 at 12:56
  • This solution seems good here, if you still have this problem can you update it with your "gem list" output and with your Gemfile.lock please? also make sure you've used bundle install. – YogiZoli Apr 03 '12 at 00:39
1

I was getting this error too (in 2015 no less) and tracked it down to *cough* not staging my most recent changes to the database.yml file in to my git repo.

Rookie mistake, I guess.

git commit -am 'added yaml production strings'
git push heroku master

Now that I am actually sending the files I thought I was sending, I no longer get the gem install activerecord-postgresql-adapter message.

I have managed to avoid both git and heroku for quite some time - years, really - and these little hiccups are coming thick and fast at the moment. I seem to be spending most of my time figuring out what is actually happening vs what I think is happening.

Ben Davis
  • 41
  • 5