0
UGH ...我打破了我的(以前的功能)Rails設置 - 在OS X Yosemite下。我使用Homebrew來更新我的Git版本。得到的Git,我想它,運行「軌道C」之後給出了這些錯誤:Broken Rails設置/ pg gem
/Users/grogers/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/pg-0.16.0/lib/pg.rb:4:in `require': dlopen(/Users/grogers/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/pg-0.16.0/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/lib/libpq.5.6.dylib (LoadError)
Referenced from: /Users/grogers/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/pg-0.16.0/lib/pg_ext.bundle
Reason: image not found - /Users/grogers/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/pg-0.16.0/lib/pg_ext.bundle
眼看參考pg_ext,我想驗證我的PostgreSQL安裝件。如果我嘗試「寶石安裝PG」或嘗試更新與打捆寶石,我得到這個:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/grogers/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
我可能使我的問題變得更糟,但我回去重做一個'釀造安裝Postgres的,但仍然會得到相同的錯誤。
任何幫助表示讚賞。謝謝!
是的。做了一個'brew安裝postgresql'。正如我所期望的那樣,報告「警告:postgresql-9.4.1已經安裝」。我只是做了一個'gem uninstall pg',它工作。但在此之後'gem install pg'仍會拋出同樣的錯誤。 – 2015-02-08 15:17:31
我的問題的開始可能會丟失上次OS升級時的Xcode安裝。試圖首先解決這個問題。雖然... – 2015-02-08 15:34:31
是的,這聽起來像您的動態庫路徑可能沒有正確設置。確保你已經安裝了Xcode和命令行工具。 'brew doctor'應該告訴你,如果你在這方面失去了什麼。此外,請確保您在乾淨的外殼中運行,以便您的路徑在安裝後全部重新加載。 – stevenharman 2015-02-08 15:38:22