我剛剛升級到Rails 3.1,我嘗試部署到Heroku的第一個應用程序遇到了與Postgres適配器相關的問題。我能夠在應用程序推送到Heroku的,但後來當我嘗試遷移數據庫,會出現以下錯誤:Rails 3.1 - 推向Heroku - 錯誤安裝postgres適配器?
Heroku的耙分貝:遷移
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)
,當我嘗試了建議安裝,我得到:
ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository
ERROR: Possible alternatives: activerecord-postgis-adapter, activerecord-jdbcpostgresql-adapter, activerecord-postgresql-cursors, activerecord-jdbcmysql-adapter, activerecord-jdbcmssql-adapter
這似乎已經有點怪,所以我應該安裝什麼確切的寶石,如果不是他們說什麼,我應該安裝讓這件事的工作?
當我嘗試安裝寶石PG我得到:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/jerometufte/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
...
我使用sqlite3的當前。任何幫助非常感謝,這讓我感到困惑。
如何設置的PostgreSQL爲Rails和Heroku的 HTTP:// robdodson .me/blog/2012/04/27/how-to-setup-postgresql-for-rails-and-heroku/ –