ruby on rails - Library not loaded: /usr/lib/libpq.5.dylib -
recently came computer (mac os x lion 10.7) i've had repeated environment issues, started new rails app, , ran
rake db:create
i got error output (with --trace):
rake aborted! dlopen(/users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle, 9): library not loaded: /usr/lib/libpq.5.dylib referenced from: /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle reason: image not found - /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg.rb:4:in `require' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg.rb:4:in `<top (required)>' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' /users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' /users/<username>/rails/<appname>/config/application.rb:7:in `<top (required)>' /users/<username>/rails/<appname>/rakefile:4:in `require' /users/<username>/rails/<appname>/rakefile:4:in `<top (required)>' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling' /users/<username>/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run' bin/rake:4:in `<main>'
config/application.rb:7 refers to:
bundler.require(:default, rails.env)
this comes on heals of couple environment issues are, i'm sure, causing issue, don't know how. basically, having issues homebrew (brew install wget wouldn't work, complaining downloaded, saying:
checking libssl... no configure: error: --with-ssl=openssl given, ssl not available
so uninstalled homebrew, uninstalled shell (fish shell), reinstalled both, , tried start things scratch. not great idea, in retrospect. seem have messed things worse were.
brew doctor seems think things ok, though. thing jumps out @ me possibly related is:
/users/sasha/.rvm/bin/pkg-config
(there's thing brought -- "/usr/bin occurs before /usr/local/bin", applies node, npm, , gcov-4.2 installs, don't seem relevant rails issue.)
and think rvm supposed to have own pkg-config install, right?
at rate, openssl installed , updated homebrew, , looking (it shows in brew list). also, xcode command line tools date well.
i guess question if has idea what's going on? i've tried reordering path comply brew doctor, un/reinstalling lots of things, updating everything, etc, , won't go away. super frustrating, cause can't without rake working. , think dylib , openssl issue might interrelated, figured i'd dump data here.
any ideas? i'd appreciate help.
thanks!
edit -- using rails 4.0, pg gem.
# bundle edge rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.0.rc1' # use postgresql database active record gem 'pg'
if makes difference.
update -- seems related this problem, i'm having. think rake not working because of pg, isn't working because of crpyto/openssl.
the problem based on inexplicably empty libssl.dylib file. there backup (libssl.dylib.bak), , overwrote empty file , -- poof -- problems went away. no idea how happened in first place, if anyone's having similar problems, i'd .bak files in usr/lib/ , (if there any) see if associated files empty.
Comments
Post a Comment