簡體   English   中英

在Mountain Lion安裝后無法安裝postgresql gem

[英]Cannot get postgresql gem installed after Mountain Lion install

自從我從Lion升級到Mountain Lion以來,我已經嘗試了一段時間來恢復我的Rails開發環境。 問題是專門安裝pg-0.14.0(postgresql)gem。

我已嘗試過這篇文章的說明但沒有運氣。 我嘗試用Homebrew卸載Postgres然后重新安裝它。 什么都行不通。 如果我嘗試安裝此gem我收到此錯誤:

Building native extensions.  This could take a while...
ERROR:  Error installing pg: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yes 
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)

*** 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.

我在哪里可以找到mkmf.log 誰能給我一個關於如何再次安裝pg gem的建議?

更新我能夠使用以下命令找到我的mkmf.log文件:

find / -name mkmf.log 2> / dev / null

有幾個失敗的xcrun調用,如下所示:

have_library:在-llibpq中檢查PQconnectdb()... -------------------- no

“xcrun cc -o conftest -I。-I / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib / ruby​​ / 1.8 / universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I / usr /local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L.-L / System /Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L.-arch i386 -arch x86_64 -L / usr / local / Cellar / postgresql / 9.1.4 / lib -lruby -llibpq -lpthread -ldl - lobjc“ld:找不到-llibpq clang的庫:錯誤:鏈接器命令失敗,退出代碼為1(使用-v查看調用)

運行xcrun時為什么會出錯? 有沒有人見過這個?

謝謝!

錯誤說它就在那里:

checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)

它找不到libpq,或者試圖編譯測試程序並鏈接到它的測試失敗。 因為它找到/usr/local/bin/pg_config它應該知道Pg庫和頭文件的位置,所以問題可能是測試編譯中的錯誤。

要了解更多信息,您需要檢查mkmf.log

find . -name mkmf.log

從您運行gem install命令的目錄中,可能會找到它。 更新您的帖子及其內容。

我終於解決了這個問題。 我使用RVM卸載ruby並重新安裝ruby版本1.9.3。 這使我可以毫無問題地運行“捆綁安裝”。 我檢查了所有裝載的寶石(寶石清單)。 但是我的rails應用程序此時無法找到postgres套接字文件。 這里詳細說明同樣的問題 而不是找到postgresql.conf文件,更改它的權限,並編輯它我只是卸載了我當前版本的Postgres並從PostGres下載了最新的One-Click安裝程序。 當我再次運行安裝程序時,它檢測到其他PostGres安裝並更新它。 這為我更新了配置,一切都很好。

我希望這可能會幫助其他一些可憐的rails dev升級到Mountain Lion :)

我也用這個掙了幾個小時,在我的設置中找不到任何工作。

我最終使用postgres.app 這是Heroku的人們發布的Postgres的打包版本。 他們說這是“在Mac上運行postgreSQL的最簡單方法”。 根據我的經驗,這是真的!

只需將其放入“應用程序”文件夾即可! (我只需要重新啟動以釋放端口5432)。

旁注:他們還發布了一個名為Induction的應用程序來管理和查詢您的數據庫,但目前它在Mountain Lion中無法使用。

如果你有Mountain Lion和XCODE 4.4.1你沒有命令工具go和dowload from https://developer.apple.com/downloads/index.action

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM