che*_*ell 14 postgresql heroku ruby-on-rails-3
我正在尝试部署到heroku.
Rails 3.1.0.rc4,
我从Heroku日志中收到以下错误:
Starting process with command: `thin -p 48902 -e production -R /home/heroku_rack/heroku.ru start`
2011-06-20T11:25:44+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `rescue in establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.) (RuntimeError)
Run Code Online (Sandbox Code Playgroud)
我试图安装activerecord-postgresql-adapter,但后来我收到此错误:
Could not find gem 'activerecord-postgresql-adapter (>= 0)' in any of the gem sources listed in your Gemfile.
Run Code Online (Sandbox Code Playgroud)
所以我试着将它添加到我的gem文件中
宝石'pg'
产生了这个错误:
Installing pg (0.11.0) with native extensions /Users/imac/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
Jar*_*eck 18
您不必在本地安装Postgres.在你的Gemfile中,将'pg'放在group:production中,如johnny-grass所示,然后当你运行bundle时,只需指定--without production,如下所示:
bundle --without production
Run Code Online (Sandbox Code Playgroud)
不幸的是,当你运行bundler时你必须记住这个论点,但至少你不必在本地安装和维护postgres.
请注意Heroku"强烈建议不要"使用sqlite,并说"您的生产和开发环境应该尽可能接近相同" http://devcenter.heroku.com/articles/rails3
Dav*_*vid 12
你有PostgreSQL的计算机上安装了?如果不这样做,请先安装它,然后安装pg gem.
# gemfile
group :production do
gem 'therubyracer-heroku', '0.8.1.pre3' # you will need this too
gem 'pg'
end
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9170 次 |
最近记录: |