2012-03-31 10 views
0

申し訳ありませんが、私はRuby on Railsで新しく、チュートリアルに従っていますが、データベースをherokuにプッシュしようとすると困っています。私はすでに私のLinuxにpostgresqlをインストールし、チュートリアルをたくさん試しました。Rails- Heroku - rake aborted! gem install activerecord-postgresql-adapter

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)

マイGemfileはこれです:私はheroku rake db:migrateを入力すると

は、私は、このエラーメッセージが表示されます

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' 

答えて

3

エラーで述べたように、あなたはPostgreSQLのアダプタをインストールする必要があります

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

gem install activerecord-postgresql-adapterでインストールしてください。また、gem 'pg'をGemfileに追加し、bundle installを実行する必要があります。


としては、あなたの代わりに、「PostgreSQLの」の「のpostgres」を書いたかどうかを確認するためにあなたのdatabase.ymlファイルを見てみましょう、hereを述べました。

+0

私はすでにこれを試してみました:エラー:任意のリポジトリで有効なgem 'activerecord-postgresql-adapter'(> = 0)を見つけることができませんでした エラー:可能な選択肢:activerecord-jdbcpostgresql-adapter、activerecord-postgis-adapter 、activerecord-jdbcmssql-adapter、activerecord-jdbcmysql-adapter、activerecord-postgresql-cursors – Aklovo

+0

私の答えを更新しました。私は解決策をラインの下に置いた。 –

+0

この解決策はここではうまくいくようですが、この問題がまだ残っている場合は、 "gem list"出力とGemfile.lockで更新できますか?また、バンドルインストールを使用していることを確認してください。 – YogiZoli

1

私はgit repoのdatabase.ymlファイルへの最近の変更をステージングせずに、このエラーも(2015年以降も)取得していました。

ルーキーミスだと思います。

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

今、私は午前実際に私が送信されたと思ったファイルを送信することを、私はもはやgem install activerecord-postgresql-adapterメッセージを取得していません。

私はかなりの時間のために、両方のgitのHerokuのを避けるために管理している - 実際には、年 - これらの小さなしゃっくりは、現時点では厚いと高速来ています。私は実際に何が起きているのかを考えて、ほとんどの時間を費やしているように思えます。

関連する問題