{"id":507,"date":"2011-10-26T09:00:55","date_gmt":"2011-10-26T08:00:55","guid":{"rendered":"https:\/\/www.yelloworb.com\/orbblog\/?p=507"},"modified":"2014-09-30T11:48:30","modified_gmt":"2014-09-30T09:48:30","slug":"how-to-get-postgresql-to-work-with-rails3-on-mac-osx-snowleopard","status":"publish","type":"post","link":"https:\/\/www.yelloworb.com\/orbblog\/how-to-get-postgresql-to-work-with-rails3-on-mac-osx-snowleopard\/","title":{"rendered":"How to get PostgreSQL to work with Rails3 on Mac OSX snowleopard"},"content":{"rendered":"<p>I&#8217;m about to host a web app on <a href=\"http:\/\/www.heroku.com\/\">Heroku<\/a> and they are using PostgreSQL for database. Followed the <a href=\"http:\/\/devcenter.heroku.com\/articles\/rails3\">instructions<\/a> and added gem &#8216;pg&#8217; to my Gemfile and made <code class=\"\" data-line=\"\">bundle install<\/code> but it failed:<br \/>\n<code class=\"\" data-line=\"\">Installing pg (0.11.0) with native extensions \/Users\/kalle\/.rvm\/rubies\/ruby-1.9.2-p290\/lib\/ruby\/site_ruby\/1.9.1\/rubygems\/installer.rb:552:in `rescue in block in build_extensions&#039;: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)<\/code><\/p>\n<p>Thought I didn&#8217;t have PostgreSQL installed so installed it via MacPorts:<br \/>\n<code class=\"\" data-line=\"\">sudo port install postgresql90<\/code><\/p>\n<p>but still got the same error! After a bit of googling I found out it was due to <a href=\"http:\/\/www.icoretech.org\/2009\/08\/how-to-install-pg-postgresql-gem-on-snow-leopard-64-bit\/\">that the bin folder was not in the path<\/a>. So by doing this it worked:<br \/>\n<code class=\"\" data-line=\"\">export PATH=\/opt\/local\/lib\/postgresql90\/bin\/:${PATH}<br \/>\nenv ARCHFLAGS=&quot;-arch x86_64&quot; bundle install<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m about to host a web app on Heroku and they are using PostgreSQL for database. Followed the instructions and added gem &#8216;pg&#8217; to my Gemfile and made bundle install but it failed: Installing pg (0.11.0) with native extensions \/Users\/kalle\/.rvm\/rubies\/ruby-1.9.2-p290\/lib\/ruby\/site_ruby\/1.9.1\/rubygems\/installer.rb:552:in `rescue in block in build_extensions&#039;: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) Thought I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[28],"tags":[],"class_list":["post-507","post","type-post","status-publish","format-standard","hentry","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/comments?post=507"}],"version-history":[{"count":2,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"predecessor-version":[{"id":509,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/posts\/507\/revisions\/509"}],"wp:attachment":[{"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yelloworb.com\/orbblog\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}