ruby-on-rails-3 – 当启动rails3.1应用程序缺少postgres宝石时,Heroku错误

前端之家收集整理的这篇文章主要介绍了ruby-on-rails-3 – 当启动rails3.1应用程序缺少postgres宝石时,Heroku错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_1@我试图部署到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)

我试图安装activerecord-postgresql-adapter,但是我收到这个错误

Could not find gem 'activerecord-postgresql-adapter (>= 0)' in any of the gem sources listed in your Gemfile.

所以我试图添加到我的宝石文件

宝石’

这产生了这个错误

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)

有任何想法吗?

解决方法

你的电脑上安装了 PostgreSQL吗?如果不先安装它,那么安装pg宝石.
# gemfile
group :production do
  gem 'therubyracer-heroku','0.8.1.pre3' # you will need this too
  gem 'pg'
end
原文链接:https://www.f2er.com/ruby/273726.html

猜你在找的Ruby相关文章