2015-11-23 51 views
0

我已經老了RoR的應用程序工作正常,在PostgreSQL 9.1,我的Mac上使用Ruby 2.0.0和Rails 4.0.2的Rails 4.2.5 PostgreSQL的 「庫未加載:libz.1.2.6.dylib」

現在我必須做的另一個項目,我想使用最新的Ruby和Rails版本:

=> ruby​​[email protected] [x86_64的]

我可以安裝PG寶石沒有問題我有in config file(insdide .bundle)this

BUNDLE_BUILD__PG: --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config 

卜當我運行「耙分貝:創建」或「軌道的」我得到這個錯誤:

LoadError: dlopen(/Users/albertcatalacasulleras/.rvm/gems/[email protected]/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.4/pg_ext.bundle, 9): Library not loaded: libz.1.2.6.dylib 
    Referenced from: /Users/albertcatalacasulleras/.rvm/gems/[email protected]/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.4/pg_ext.bundle 
    Reason: image not found - /Users/albertcatalacasulleras/.rvm/gems/[email protected]/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.4/pg_ext.bundle 

我覺得有東西在Rails的4.2.5或2.2.3紅寶石,使這次崩潰。

在此先感謝

回答

0

感謝Craig林格的this answare我找到了解決辦法:

添加export DYLD_LIBRARY_PATH=/library/PostgreSQL/9.1/lib:$DYLD_LIBRARY_PATH 到.bash_rofile文件

將它有兩個PstgreSQL數據庫9.1和9.4的另一個問題, por example ...

0

我遇到了同樣類型的問題,它解決了我卸載pg gem並使用選項重新安裝它l下面是ike。

sudo gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config 

尋找在你的Postgres應用程序的安裝路徑pg_config文件,並給該路徑如上圖所示。

請參考以下網址瞭解更多詳情。

Github url link

相關問題