Gem install pg:无法创建Makefile

时间:2014-04-02 19:49:49

标签: ruby-on-rails ruby postgresql makefile gem

安装pg时出现以下错误:

*** 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时,会显示以下问题:

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

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

"xcrun clang -o conftest -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin13 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I. -I/usr/local/Cellar/postgresql/9.3.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L/usr/local/Cellar/postgresql/9.3.2/lib -L. -L/usr/local/lib  -Wno-error=unused-command-line-argument-hard-error-in-future gem install json   -lruby.2.0.0  -lpthread -ldl -lobjc "
clang: error: no such file or directory: 'gem'
clang: error: no such file or directory: 'install'
clang: error: no such file or directory: 'json'
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

我尝试将失败的命令复制并粘贴到终端中,我得到了同样的错误。我不知道这个错误意味着什么或为什么会发生。有什么建议吗?

0 个答案:

没有答案