{"id":992,"date":"2012-06-30T13:19:16","date_gmt":"2012-06-30T21:19:16","guid":{"rendered":"http:\/\/www.wiredatom.com\/blog\/?p=992"},"modified":"2014-09-17T23:22:04","modified_gmt":"2014-09-18T06:22:04","slug":"postgresql-install-errors-on-osx","status":"publish","type":"post","link":"https:\/\/www.wiredatom.com\/blog\/2012\/06\/30\/postgresql-install-errors-on-osx\/","title":{"rendered":"Postgresql Install Errors on OSX"},"content":{"rendered":"<p><strong>Update 09\/17\/2014:<\/strong> I&#8217;ve pretty much deprecated use of MacPorts and gone exclusively to Homebrew since this post. And I haven&#8217;t run into this problem since this post.<\/p>\n<p><strong>Update 12\/28\/2012:<\/strong> There&#8217;s an easier way to run PostgreSQL! <a href=\"http:\/\/mattt.me\/\">Mattt Thompson<\/a> has written <a href=\"http:\/\/postgresapp.com\/\">Postgres app<\/a> for Mac OSX that allows the database to run completely self-contained! Hassle-free! Last week I was trying out <a href=\"http:\/\/www.sinatrarb.com\/\">Sinatra<\/a> and <a href=\"http:\/\/www.padrinorb.com\/\">Padrino<\/a> with PostgreSQL. But for the life of me, I couldn&#8217;t get PostgreSQL to run. At first I thought it was an issue with using MacPorts again. But after some googling, it seems like others who used Homebrew also had similar issues.<\/p>\n<p><div class=\"codecolorer-container bash railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/><\/div><\/td><td><div class=\"bash codecolorer\">could not connect to database postgres: could not connect to server: Permission denied<br \/>\n&nbsp; &nbsp; Is the server running locally and accepting<br \/>\n&nbsp; &nbsp; connections on Unix domain socket <span class=\"st0\">&quot;\/var\/pgsql_socket\/.s.PGSQL.5432&quot;<\/span>?<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<\/p>\n<p>There are a couple of ways to deal with this. One of them is to include the PostgreSQL path on OSX&#8217;s commandline lookup chain. In your <code class=\"codecolorer bash default\"><span class=\"bash\">.bash_profile<\/span><\/code> (or <code class=\"codecolorer bash default\"><span class=\"bash\">.profile<\/span><\/code> for others) file, you could add the path to the PostgreSQL binaries:<\/p>\n<div class=\"codecolorer-container bash railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><div class=\"bash codecolorer\">&nbsp;<span class=\"kw3\">export<\/span> <span class=\"re2\">PATH<\/span>=<span class=\"sy0\">\/<\/span>opt<span class=\"sy0\">\/<\/span>local<span class=\"sy0\">\/<\/span>bin:<span class=\"sy0\">\/<\/span>opt<span class=\"sy0\">\/<\/span>local<span class=\"sy0\">\/<\/span>sbin:<span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span>local<span class=\"sy0\">\/<\/span>mysql<span class=\"sy0\">\/<\/span>bin:<span class=\"sy0\">\/<\/span>opt<span class=\"sy0\">\/<\/span>local<span class=\"sy0\">\/<\/span>lib<span class=\"sy0\">\/<\/span>postgresql91<span class=\"sy0\">\/<\/span>bin:<span class=\"re1\">$PATH<\/span><\/div><\/div>\n<p>Make sure the version number on PostgreSQL matches the version you are running.<\/p>\n<p>References<br \/>\n* <a href=\"http:\/\/damosworld.wordpress.com\/2011\/04\/09\/installation-of-postgresql-on-macos-x-using-macports\/\">Installation of Postgresql on MacOS X using Macports<\/a><br \/>\n* <a href=\"http:\/\/bsnyderblog.blogspot.com\/2011\/09\/installing-postgresql-90-on-mac-os-x.html\">Installing PostgreSQL 9.0 on Mac OS X 10.6.8 via MacPorts<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update 09\/17\/2014: I&#8217;ve pretty much deprecated use of MacPorts and gone exclusively to Homebrew since this post. And I haven&#8217;t run into this problem since this post. Update 12\/28\/2012: There&#8217;s an easier way to run PostgreSQL! Mattt Thompson has written Postgres app for Mac OSX that allows the database to run completely self-contained! Hassle-free! Last &hellip; <a href=\"https:\/\/www.wiredatom.com\/blog\/2012\/06\/30\/postgresql-install-errors-on-osx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Postgresql Install Errors on OSX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21,3],"tags":[],"class_list":["post-992","post","type-post","status-publish","format-standard","hentry","category-coding","category-mac-osx"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p54IqZ-g0","_links":{"self":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/comments?post=992"}],"version-history":[{"count":1,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions"}],"predecessor-version":[{"id":1005,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/992\/revisions\/1005"}],"wp:attachment":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/media?parent=992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/categories?post=992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/tags?post=992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}