Ruby   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ruby-on-rails-3 – 当启动rails3.1应用程序缺少postgres宝石时,Heroku错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图部署到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

大佬总结

以上是大佬教程为你收集整理的ruby-on-rails-3 – 当启动rails3.1应用程序缺少postgres宝石时,Heroku错误全部内容,希望文章能够帮你解决ruby-on-rails-3 – 当启动rails3.1应用程序缺少postgres宝石时,Heroku错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。