2016-05-16 69 views
1

我想運行捆綁EXEC耙數據庫:遷移,並已經有一段時間了,我一直得到這個問題。有任何想法嗎?我已經嘗試過捆綁安裝,捆綁更新等。我已經附加了我的gemfile,所以你可以看到。它可能是我的gemfile.lock?找不到耙子,但安裝了寶石。已經做了捆綁更新等

sample_app LMagnotti$ bundle exec rake db:migrate 
Could not find rake-11.1.2 in any of the sources 
Run `bundle install` to install missing gems. 

的Gemfile

source 'https://rubygems.org' 
gem 'rails', '4.2.2' 
gem 'sass-rails', '~> 5.0' 
gem 'uglifier', '>= 1.3.0' 
gem 'coffee-rails', '~> 4.1.0' 
gem 'bootstrap-sass', '~> 3.2.0.0' 
gem 'jquery-rails' 
gem 'turbolinks' 
gem 'jbuilder', '~> 2.0' 
gem 'sdoc', '~> 0.4.0' 
gem 'pg', '0.18.4' 
gem 'rake', '11.1.2' 

group :development do 
    gem 'byebug' 
    gem 'web-console', '~> 2.0' 
    gem 'spring' 
    gem 'sqlite3', '1.3.7' 
end 

的Gemfile鎖定

GEM 
    remote: https://rubygems.org/ 
    specs: 
    actionmailer (4.2.2) 
     actionpack (= 4.2.2) 
     actionview (= 4.2.2) 
     activejob (= 4.2.2) 
     mail (~> 2.5, >= 2.5.4) 
     rails-dom-testing (~> 1.0, >= 1.0.5) 
    actionpack (4.2.2) 
     actionview (= 4.2.2) 
     activesupport (= 4.2.2) 
     rack (~> 1.6) 
     rack-test (~> 0.6.2) 
     rails-dom-testing (~> 1.0, >= 1.0.5) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    actionview (4.2.2) 
     activesupport (= 4.2.2) 
     builder (~> 3.1) 
     erubis (~> 2.7.0) 
     rails-dom-testing (~> 1.0, >= 1.0.5) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    activejob (4.2.2) 
     activesupport (= 4.2.2) 
     globalid (>= 0.3.0) 
    activemodel (4.2.2) 
     activesupport (= 4.2.2) 
     builder (~> 3.1) 
    activerecord (4.2.2) 
     activemodel (= 4.2.2) 
     activesupport (= 4.2.2) 
     arel (~> 6.0) 
    activesupport (4.2.2) 
     i18n (~> 0.7) 
     json (~> 1.7, >= 1.7.7) 
     minitest (~> 5.1) 
     thread_safe (~> 0.3, >= 0.3.4) 
     tzinfo (~> 1.1) 
    arel (6.0.3) 
    binding_of_caller (0.7.2) 
     debug_inspector (>= 0.0.1) 
    bootstrap-sass (3.2.0.2) 
     sass (~> 3.2) 
    builder (3.2.2) 
    byebug (9.0.3) 
    coffee-rails (4.1.1) 
     coffee-script (>= 2.2.0) 
     railties (>= 4.0.0, < 5.1.x) 
    coffee-script (2.4.1) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.10.0) 
    concurrent-ruby (1.0.2) 
    debug_inspector (0.0.2) 
    erubis (2.7.0) 
    execjs (2.6.0) 
    globalid (0.3.6) 
     activesupport (>= 4.1.0) 
    i18n (0.7.0) 
    jbuilder (2.4.1) 
     activesupport (>= 3.0.0, < 5.1) 
     multi_json (~> 1.2) 
    jquery-rails (4.1.1) 
     rails-dom-testing (>= 1, < 3) 
     railties (>= 4.2.0) 
     thor (>= 0.14, < 2.0) 
    json (1.8.3) 
    loofah (2.0.3) 
     nokogiri (>= 1.5.9) 
    mail (2.6.4) 
     mime-types (>= 1.16, < 4) 
    mime-types (3.0) 
     mime-types-data (~> 3.2015) 
    mime-types-data (3.2016.0221) 
    mini_portile2 (2.0.0) 
    minitest (5.8.4) 
    multi_json (1.12.0) 
    nokogiri (1.6.7.2) 
     mini_portile2 (~> 2.0.0.rc2) 
    pg (0.18.4) 
    rack (1.6.4) 
    rack-test (0.6.3) 
     rack (>= 1.0) 
    rails (4.2.2) 
     actionmailer (= 4.2.2) 
     actionpack (= 4.2.2) 
     actionview (= 4.2.2) 
     activejob (= 4.2.2) 
     activemodel (= 4.2.2) 
     activerecord (= 4.2.2) 
     activesupport (= 4.2.2) 
     bundler (>= 1.3.0, < 2.0) 
     railties (= 4.2.2) 
     sprockets-rails 
    rails-deprecated_sanitizer (1.0.3) 
     activesupport (>= 4.2.0.alpha) 
    rails-dom-testing (1.0.7) 
     activesupport (>= 4.2.0.beta, < 5.0) 
     nokogiri (~> 1.6.0) 
     rails-deprecated_sanitizer (>= 1.0.1) 
    rails-html-sanitizer (1.0.3) 
     loofah (~> 2.0) 
    railties (4.2.2) 
     actionpack (= 4.2.2) 
     activesupport (= 4.2.2) 
     rake (>= 0.8.7) 
     thor (>= 0.18.1, < 2.0) 
    rake (11.1.2) 
    rdoc (4.2.2) 
     json (~> 1.4) 
    sass (3.4.22) 
    sass-rails (5.0.4) 
     railties (>= 4.0.0, < 5.0) 
     sass (~> 3.1) 
     sprockets (>= 2.8, < 4.0) 
     sprockets-rails (>= 2.0, < 4.0) 
     tilt (>= 1.1, < 3) 
    sdoc (0.4.1) 
     json (~> 1.7, >= 1.7.7) 
     rdoc (~> 4.0) 
    spring (1.7.1) 
    sprockets (3.6.0) 
     concurrent-ruby (~> 1.0) 
     rack (> 1, < 3) 
    sprockets-rails (3.0.4) 
     actionpack (>= 4.0) 
     activesupport (>= 4.0) 
     sprockets (>= 3.0.0) 
    sqlite3 (1.3.7) 
    thor (0.19.1) 
    thread_safe (0.3.5) 
    tilt (2.0.4) 
    turbolinks (2.5.3) 
     coffee-rails 
    tzinfo (1.2.2) 
     thread_safe (~> 0.1) 
    uglifier (3.0.0) 
     execjs (>= 0.3.0, < 3) 
    web-console (2.3.0) 
     activemodel (>= 4.0) 
     binding_of_caller (>= 0.7.2) 
     railties (>= 4.0) 
     sprockets-rails (>= 2.0, < 4.0) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    bootstrap-sass (~> 3.2.0.0) 
    byebug 
    coffee-rails (~> 4.1.0) 
    jbuilder (~> 2.0) 
    jquery-rails 
    pg (= 0.18.4) 
    rails (= 4.2.2) 
    rake (= 11.1.2) 
    sass-rails (~> 5.0) 
    sdoc (~> 0.4.0) 
    spring 
    sqlite3 (= 1.3.7) 
    turbolinks 
    uglifier (>= 1.3.0) 
    web-console (~> 2.0) 

BUNDLED WITH 
    1.12.0 

我去卸載的耙,然後再重新安裝。現在,當我運行的db:遷移,我看到這個

sample_app LMagnotti$ bundle exec rake db:migrate 
Could not find i18n-0.7.0 in any of the sources 
Run `bundle install` to install missing gems. 

當我運行bundle立即安裝,這是我所看到的:

An error occurred while installing pg (0.18.4), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling. 

然後我安裝了它......

Building native extensions. This could take a while... 
Successfully installed pg-0.18.4 
Parsing documentation for pg-0.18.4 
Done installing documentation for pg after 2 seconds 
1 gem installed 

包更新之後,我現在得到擊中與此錯誤:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/pg-0.18.4/ext 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160516-9499-1ex1lm8.rb 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. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 
    --with-pg 
    --without-pg 
    --enable-windows-cross 
    --disable-windows-cross 
    --with-pg-config 
    --without-pg-config 
    --with-pg_config 
    --without-pg_config 
    --with-pg-dir 
    --without-pg-dir 
    --with-pg-include 
    --without-pg-include=${pg-dir}/include 
    --with-pg-lib 
    --without-pg-lib=${pg-dir}/ 
    --with-pqlib 
    --without-pqlib 
    --with-libpqlib 
    --without-libpqlib 
    --with-ms/libpqlib 
    --without-ms/libpqlib 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/extensions/universal-darwin-15/2.0.0/pg-0.18.4/mkmf.log 

extconf failed, exit code 1 

Gem files will remain installed in /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/pg-0.18.4 for inspection. 
Results logged to /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/extensions/universal-darwin-15/2.0.0/pg-0.18.4/gem_make.out 
Installing tilt 2.0.4 
Installing spring 1.7.1 
Installing sqlite3 1.3.7 with native extensions 
Installing rdoc 4.2.2 
Installing tzinfo 1.2.2 
Installing nokogiri 1.6.7.2 with native extensions 
Installing rack-test 0.6.3 
Installing mime-types 3.0 
Installing binding_of_caller 0.7.2 with native extensions 
Installing bootstrap-sass 3.2.0.2 
Installing coffee-script 2.4.1 
Installing uglifier 3.0.0 
Installing sprockets 3.6.0 
An error occurred while installing pg (0.18.4), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling. 

日誌則這樣說:

find_executable: checking for pg_config... -------------------- yes 

-------------------- 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -lpthread -ldl -lobjc " 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main(int argc, char **argv) 
4: { 
5: return 0; 
6: } 
/* end */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -Wl,-rpath,/usr/local/lib -lpthread -ldl -lobjc " 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main() {return 0;} 
/* end */ 

find_header: checking for libpq-fe.h... -------------------- yes 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch i386 -arch x86_64 -c conftest.c" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
/* end */ 

-------------------- 

find_header: checking for libpq/libpq-fs.h... -------------------- yes 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch i386 -arch x86_64 -c conftest.c" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq/libpq-fs.h> 
/* end */ 

-------------------- 

find_header: checking for pg_config_manual.h... -------------------- yes 

"xcrun clang -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -arch i386 -arch x86_64 -c conftest.c" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <pg_config_manual.h> 
/* end */ 

-------------------- 

have_library: checking for PQconnectdb() in -lpq... -------------------- no 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -lpq -lpthread -ldl -lobjc " 
ld: warning: ignoring file /usr/local/lib/libpq.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libpq.dylib 
Undefined symbols for architecture i386: 
    "_PQconnectdb", referenced from: 
     _t in conftest-07e7b9.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -lpq -lpthread -ldl -lobjc " 
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified 
int t(void) { PQconnectdb(); return 0; } 
       ~~~~~~~~~~~^
/usr/local/Cellar/postgresql/9.5.2/include/libpq-fe.h:250:1: note: 'PQconnectdb' declared here 
extern PGconn *PQconnectdb(const char *conninfo); 
^ 
1 error generated. 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { PQconnectdb(); return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

-------------------- 

have_library: checking for PQconnectdb() in -llibpq... -------------------- no 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -llibpq -lpthread -ldl -lobjc " 
ld: library not found for -llibpq 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -llibpq -lpthread -ldl -lobjc " 
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified 
int t(void) { PQconnectdb(); return 0; } 
       ~~~~~~~~~~~^
/usr/local/Cellar/postgresql/9.5.2/include/libpq-fe.h:250:1: note: 'PQconnectdb' declared here 
extern PGconn *PQconnectdb(const char *conninfo); 
^ 
1 error generated. 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { PQconnectdb(); return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

-------------------- 

have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -lms/libpq -lpthread -ldl -lobjc " 
ld: library not found for -lms/libpq 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.5.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/lib -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -arch i386 -arch x86_64 -lruby.2.0.0 -lms/libpq -lpthread -ldl -lobjc " 
conftest.c:7:27: error: too few arguments to function call, single argument 'conninfo' was not specified 
int t(void) { PQconnectdb(); return 0; } 
       ~~~~~~~~~~~^
/usr/local/Cellar/postgresql/9.5.2/include/libpq-fe.h:250:1: note: 'PQconnectdb' declared here 
extern PGconn *PQconnectdb(const char *conninfo); 
^ 
1 error generated. 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <libpq-fe.h> 
4: 
5: /*top*/ 
6: extern int t(void); 
7: int t(void) { PQconnectdb(); return 0; } 
8: int main(int argc, char **argv) 
9: { 
10: if (argc > 1000000) { 
11:  printf("%p", &t); 
12: } 
13: 
14: return 0; 
15: } 
/* end */ 

-------------------- 
+1

'捆綁檢查'是否快樂? 'bundle show'包含'rake'嗎? – tadman

+0

嘿@tadman感謝您的幫助。是的,捆綁檢查是滿意的,捆綁顯示說耙(11.1.2)。當我回到卸載耙並重新安裝,然後運行db:migrate時,我看到了這一點。 –

+1

'bundle install'給你什麼? – amulous

回答

3

我認爲這個問題是這些行:

Can't find the PostgreSQL client library (libpq) 
... 
ld: warning: ignoring file /usr/local/lib/libpq.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libpq.dylib 

libpq是操作系統級別庫(而不是一個Ruby寶石),可能需要在如果你在Linux上,或者在OS X上安裝了yumapt-get。例如,在基於Ubuntu的Linux Mint上,有一個名爲postgres-client-9.3的包,我懷疑(但不確定)是否包含libpq

根據錯誤消息,您安裝了libpqx86_64(64位)版本,但您的操作系統體系結構爲i386(我認爲是32位)。

你是如何安裝Postgres客戶端庫的?它是否作爲Postgres數據庫本身的一部分進行安裝?如果是這樣,你是否從網上下載了一個軟件包,如果是的話,它是一個64位的軟件包嗎?你可以去找一個32位的包,而卸載Postgres後,重新安裝Postgres。