[英]Could not bundle install because of 'pg'
我正在學習R oR。然后,我想使用postgresql創建一個網站。 但是,這個錯誤使我發瘋。 請幫我 !
$ sudo bundle install
creating Makefile
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_connection.c
pg_connection.c:2323:3: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday(&currtime, NULL);
^
1 warning generated.
compiling pg_errors.c
compiling pg_result.c
linking shared-object pg_ext.bundle
ld: file not found: dynamic_lookup
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_ext.bundle] Error 1
Gem files will remain installed in /Users/Sean/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.17.1 for inspection.
Results logged to /Users/Sean/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.17.1/ext/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
例如,我嘗試更改pg的通過。 但是,我做不到。
然后,我嘗試
$ brew update
$ brew uninstall postgresql
$ brew install postgresql
$ gem install pg
$ bundle install
但是,它沒有用。
我該怎么辦!
您可能需要libpq-dev
,這是嘗試在新計算機上安裝pg gem時總能得到的庫。
使用Ruby 2.2.1運行pg gem 0.17時遇到了相同的問題
我只是做了一個bundle update pg
,它升級到0.18,它不再有這個編譯問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.