0

I have a Ruby on Rails app which uses the PostgreSQL database. Attempting to start the server this morning I get the following error from the server log

rails s
/Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/lib/pg.rb:4:in `require': dlopen(/Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/lib/libpq.5.5.dylib (LoadError)
Referenced from: /Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/lib/pg_ext.bundle
Reason: image not found - /Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/lib/pg_ext.bundle

Further examination showed that the Postgresql database had not started.

Checking on the files referenced, I could find but not open - "Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/lib/pg_ext.bundle"

Initially I was totally lost as to why this error had occured. Further reflection reminded me that I had run "brew upgrade" yesterday and perhaps this has caused the error?

I am fairly new to Mac. I am running Mac OS X 10.6.8, so I'm little hesitant to just dive in and add files, uninstall/re-install PostgreSQL - especially before I know what is causing the problem. Does anyone have any ideas/suggestions?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
user1854802
  • 388
  • 3
  • 14
  • This answer here is related to your problem http://stackoverflow.com/a/16453477/2860804 – wytlytning101 Oct 09 '13 at 00:57
  • thanks - Tried the first two solutions from limk. With both I then when trying to "rails s" I was prompted to do "bundle install". When doing this I got error "Errno::EACCES: Permission denied - /Users/davidlee/.rvm/gems/ruby-1.9.3-p286/gems/pg-0.15.1/.gemtest" – user1854802 Oct 09 '13 at 01:51

1 Answers1

0

The inital error was caused by me running Brew Upgrade which updated Postgresql from 9x (it really wasn't clear from the directories) to Postgresql 9.3. I didn't realise what had happened at the time.

This caused Postgresql to not start up as running version 9.3 and data structures were from 9.2 (I think). When I figured ot what happened I tried to back out the change - which I couldn't do. I then tried to update the data (using a number of webpages esp http://blog.55minutes.com/2013/09/postgresql-93-brew-upgrade/. As I couldn't find the data dictionary for the old version I had to set up the Postgresql 9.3 database from scratch making sure to sure same databse name etc and then running rake db:schema:load and had some data in rake db:init.

Pierre

user1854802
  • 388
  • 3
  • 14