加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 20:35:38 所属栏目:百科 来源:网络整理
导读:我试图部署到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/ac
我试图部署到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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读