我認爲這是一個常見問題,但是我在互聯網上找到的解決方案並不適合我。當我運行包本節在我的Gemfile安裝軟件包安裝Postgresql錯誤
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", :require => "sqlite3"
end
我收到以下錯誤
creating Makefile
make
compiling gvl_wrappers.c
compiling pg.c
pg.c: In function ‘Init_pg_ext’:
pg.c:375: error: ‘PQPING_OK’ undeclared (first use in this function)
pg.c:375: error: (Each undeclared identifier is reported only once
pg.c:375: error: for each function it appears in.)
pg.c:377: error: ‘PQPING_REJECT’ undeclared (first use in this function)
pg.c:379: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function)
pg.c:381: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function)
make: *** [pg.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.16.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.16.0/ext/gem_make.out
下一步,根據我所發現的,是運行locate pg_config
,然後將位置命令行語句後的gem install pg
。不過,我得到這個錯誤,而不是:
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
我然後運行sudo
命令,並獲得這最後的錯誤....
launchctl: Couldn't stat("/System/Library/LaunchDaemons/com.apple.locate.plis"): No such file or directory
nothing found to load
這是我在使用該技術的第一次嘗試,全新的到Mac也是如此。任何幫助,將不勝感激。謝謝!
編輯
我試圖遵循建議located here關於此錯誤。
這是一個的.plist文件,而不是.plis - 您可以使用mdfind,而不是定位在Mac上。 mdfind使用文件的mac os x spotlight數據庫 – Ivan
能夠追蹤pg_config文件('/ usr/bin/pg_config')的位置,但在將其添加到'gem install'語句後仍然收到相同的錯誤。 – NealR