2012-03-13 4 views
0
나는 "에게 Heroku는 갈퀴 DB를 실행 마이그레이션"실행하고

내가 Heroku가 내 응용 프로그램을 배포 한 후 나는이 얻을 :의 RoR 응용 프로그램 배포

을 $ >>에게 Heroku는 갈퀴 DB를 실행 마이그레이션을

Running rake db:migrate attached to terminal... up, run.1 
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 <top (required)> at /app/Rakefile:7) 
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 <top (required)> at /app/Rakefile:7) 
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 <top (required)> 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) 

언급 한 보석을 설치하려고했지만 아무 일도 일어나지 않습니다. 나는 루비 1.9.3를 rails3 사용하고, 내 database.yml을 파일에는 다음이 포함

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

가 어떻게이 오류를 해결할 수 있습니까?

편집 :

내가이 오류를 얻고있다

Building native extensions. This could take a while... 
ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.8 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 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/usr/bin/ruby1.8 
    --with-pg 
    --without-pg 
    --with-pg-dir 
    --without-pg-dir 
    --with-pg-include 
    --without-pg-include=${pg-dir}/include 
    --with-pg-lib 
    --without-pg-lib=${pg-dir}/lib 
    --with-pg-config 
    --without-pg-config 
    --with-pg_config 
    --without-pg_config 


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/pg-0.13.2 for inspection. 
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/gem_make.out 

$ >> sudo는 보석이 페이지 -v '0.13.2'를 설치 실행. 다시 나는 1.9.3 버전의 루비를 사용하고있다.

+0

postgresql 또는 sqlite3을 사용하려고합니까? –

답변

1

귀하의 database.yml은 sqlite3을 사용하도록 설정되었습니다.

postgresql을 사용하려면 먼저 컴퓨터에 postgres를 설치해야합니다. Linux의 경우

:

최대 OS X의 경우
sudo apt-get install postgresql 

:

brew install postgresql 

homebrew 먼저 설치해야합니다.

heroku는 배포시 database.yml을 자동 생성합니다. 읽기처럼 : 당신이 database.yml에 넣는 것이 중요하지 않다. 나에게 좋은데, 생산 DB 암호에 대해 걱정하지 않고 git에 넣을 수 있기 때문이다.

그런 다음 Gemfile이를 바꾸어 페이지 보석을 설치합니다

보석 '페이지'> '페이지'

당신이 레일의 이전 버전을 사용하는 경우이 방법을 설치하는 보석을 사용 = 필요 .

+0

거기에 없습니다. btw 나는 나의 질문을 편집했다 –

+0

Eric, Heroku는'database.yml'에 무엇을 넣든 항상 Postgres를 사용합니다. 그러나 자신의 SQL을 롤링하지 않는 한 로컬에서 SQLite를 실행하고 Heroku에서 Postgres를 실행해도 아무런 해가 없습니다.OP의 원래 문제는 Heroku 배포와 관련이 있습니다. 이제 그는 Postgres를 로컬에 설치하는 또 다른 문제에 직면하고 있습니다. 원래 질문과 다른 점이 있습니다. –

+0

OK, 답을 편집하여이 사실을 반영한 것을 보았습니다. –

0

'pg'보석을 Gemfile에 추가하십시오 (그리고 나서 bundle install).

+0

database.yml은 postgresql @alex –

+0

을 사용하고 있지 않음을 보여 주며 postgresql을 사용하도록 구성하려면 어떻게해야합니까? –

+0

@Alex D : 내 질문을 편집했습니다. –