似乎很多其他人在安装pg gem时遇到了问题.没有为他人提出的解决方案对我有用.
我试图安装pg gem和postgres.app.pg gem不会安装.我得到的第一个错误是:
安装pg(0.17.0)时发生错误,Bundler无法继续.gem install pg -v '0.17.0'在捆绑之前确保成功.
关于将我的gem安装指向pg的配置的安装建议失败,并显示以下错误消息(此论坛上的许多其他人遇到过):
Failed to build native extensions... Results logged to /Users/melanie/.rvm/gems/ruby-1.9.3-p448/gems/pg-0.17.0/ext/gem_make.out
Run Code Online (Sandbox Code Playgroud)
我不知道如何查找或访问此日志文件以搜索更多线索.
当我尝试使用sudo apt-get install命令时,我也收到错误消息(找不到命令).在过去的6个小时里,我一直在搜索这个论坛,尝试了每一条建议,让pg与我的rails项目合作.
我找不到关于如何更改路径的建议,或者具体地说,需要进行哪些更改.我which pg_config返回一个文件源.我已经使用命令来使用该配置安装pg.它失败.
有这么多人遇到麻烦.许多答案都表明了自制软件.我不得不删除它,因为它抛出了其他问题.
在我的mac OSX 10.6 32位,我可以很容易地安装mysql2 gem,但不能在mini mac 10.6 64bit服务器上安装.
我在麻烦的服务器上安装了MySQL 5.5.11,而在我的家里mac MySQL 5.5.0.m2不知何故当我运行bundle install时,在服务器中它试图在家里安装mysql2.0.3.2 mysql2.0.2.6
请不要告诉我
env ARCHFLAGS =" - arch x86_64"sudo gem install mysql2 --version'= 0.2.6' - --with-mysql-config =/usr/local/mysql/bin/mysql_config
我试过了,不行.
$ PATH中包含的/ usr/local/mysql/bin也没有帮助.
错误代码:
Installing mysql2 (0.3.2) with native extensions /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/administrator/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try …Run Code Online (Sandbox Code Playgroud) Mac OS El Capitan
捆绑安装失败:
compiling pg_connection.c
pg_connection.c:2394:3: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday(&currtime, NULL);
^
1 warning generated.
compiling pg_copy_coder.c
compiling pg_errors.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
compiling pg_type_map.c
compiling pg_type_map_all_strings.c
compiling pg_type_map_by_class.c
compiling pg_type_map_by_column.c
compiling pg_type_map_by_mri_type.c
compiling pg_type_map_by_oid.c
compiling pg_type_map_in_ruby.c
compiling util.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
make failed, …Run Code Online (Sandbox Code Playgroud) 我在Mac(10.6.8)上遇到了Ruby(1.9.3),Rails和Postgres(9.0.8)的设置.每次运行时rails console我都会收到以下错误:
/Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg.rb:4:in `require': dlopen(/Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg_ext.bundle, 9): Library not loaded: @loader_path/../lib/libssl.dylib (LoadError)
Referenced from: /usr/lib/libpq.5.dylib
Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later, but libssl.0.9.8.dylib provides version 0.9.8 - /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg_ext.bundle
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/pg-0.13.2/lib/pg.rb:4:in `<top (required)>'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
from /Users/dc/Documents/Aptana Studio 3 Workspace/http/config/application.rb:7:in `<top (required)>'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/railties-3.2.6/lib/rails/commands.rb:39:in `require'
from /Users/dc/.rvm/gems/ruby-1.9.3-head@global/gems/railties-3.2.6/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in …Run Code Online (Sandbox Code Playgroud)