Heroku错误,当启动rails3.1应用程序缺少postgres宝石 [英] Heroku error when launch rails3.1 app missing postgres gem
本文介绍了Heroku错误,当启动rails3.1应用程序缺少postgres宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Rails 3.1.0.rc4,
我得到从Heroku日志中发现以下错误:
使用命令启动进程:`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:在`rescue in establish_connection'中:请安装postgresql适配器:`gem install activerecord-postgresql-adapter`(pg不是bundle的一部分。它到Gemfile。)(RuntimeError)
我试图安装activerecord-postgresql-adapter,但后来我得到这个错误:
在任何宝石中找不到gem'activerecord-postgresql-adapter(> = 0)'来源列在您的Gemfile中。
所以我试着把它添加到我的gem文件中
gem'pg'
产生了这个错误:
使用本机扩展安装pg(0.11.0)/Users/imac/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in`在build_extensions块中救援:错误:无法构建gem本机扩展。 (Gem :: Installer :: ExtensionBuildError)
有什么想法?
解决方案
您是否安装了 PostgreSQL 你的电脑?如果您没有先安装它,请安装pg gem。
#gemfile
组:生产do
gem'therubyracer-heroku','0.8.1。 pre3'#你也需要这个
gem'pg'
end
I am trying to deploy to heroku.
Rails 3.1.0.rc4,
I get the following error from Heroku logs:
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)
I tried to install the activerecord-postgresql-adapter but then I get this error:
Could not find gem 'activerecord-postgresql-adapter (>= 0)' in any of the gem sources listed in your Gemfile.
So I tried to add this to my gem file
gem 'pg'
which produced this error:
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)
any ideas?
解决方案
Do you have PostgreSQL installed on your computer? If you don't then install it first, then install the pg gem.
# gemfile
group :production do
gem 'therubyracer-heroku', '0.8.1.pre3' # you will need this too
gem 'pg'
end
这篇关于Heroku错误,当启动rails3.1应用程序缺少postgres宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文