gpt4 book ai didi

安装 OSX Yosemite 和 Xcode 6 后出现 Ruby gem 安装错误

转载 作者:数据小太阳 更新时间:2023-10-29 06:44:31 26 4
gpt4 key购买 nike

我尝试像安装 Yosemite 之前那样安装 gem,但现在出现错误:

/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `synchronize': 错误:无法构建 gem native 扩展。 ( gem ::Ext::BuildError)

错误:无法构建 gem native 扩展。

死锁;递归锁定

这是我写的命令:

sudo gem install mysql2

这是它出现在终端中的消息:

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/autotest-fsevent-0.2.9 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/autotest-fsevent-0.2.9/gem_make.out

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/autotest-fsevent-0.2.9 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/autotest-fsevent-0.2.9/gem_make.out from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in build_extension' from
/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in
block in build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in each' from
/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in
build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in block in
build_extensions' from
/Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in
use_ui' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in build_extensions' from
/Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in
build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in contains_requirable_file?' from
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:925:in
block in find_inactive_by_path' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in each' from
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in
find' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in find_inactive_by_path' from
/Library/Ruby/Site/2.0.0/rubygems.rb:185:in
try_activate' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:132:in rescue in require' from
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
require' from /Library/Ruby/Site/2.0.0/rubygems.rb:601:in load_yaml' from
/Library/Ruby/Site/2.0.0/rubygems/config_file.rb:328:in
load_file' from /Library/Ruby/Site/2.0.0/rubygems/config_file.rb:197:in initialize' from /Library/Ruby/Site/2.0.0/rubygems.rb:289:innew' from /Library/Ruby/Site/2.0.0/rubygems.rb:289:in configuration'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:63:in
run' from /Library/Ruby/Site/2.0.0/rubygems/ext/ext_conf_builder.rb:38:in block in build' from
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tempfile.rb:324:in
open' from /Library/Ruby/Site/2.0.0/rubygems/ext/ext_conf_builder.rb:17:in build' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:161:in
block (2 levels) in build_extension' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in chdir' from
/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in
block in build_extension' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in synchronize'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in
build_extension' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in block in
build_extensions' from
/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in
each' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in build_extensions' from
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in
block in build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in
build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in build_extensions' from
/Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in
contains_requirable_file?' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:925:in block in
find_inactive_by_path' from
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in
each' from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in find' from
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in
find_inactive_by_path' from /Library/Ruby/Site/2.0.0/rubygems.rb:185:in try_activate' from
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:132:in
rescue in require' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:in require' from /Library/Ruby/Site/2.0.0/rubygems.rb:601:in
load_yaml' from /Library/Ruby/Site/2.0.0/rubygems/config_file.rb:328:in load_file'
from /Library/Ruby/Site/2.0.0/rubygems/config_file.rb:197:in
initialize' from /Library/Ruby/Site/2.0.0/rubygems/gem_runner.rb:74:in new' from
/Library/Ruby/Site/2.0.0/rubygems/gem_runner.rb:74:in
do_configuration' from /Library/Ruby/Site/2.0.0/rubygems/gem_runner.rb:39:in run' from
/usr/bin/gem:21:in
'

我使用的是 OSX 10.10 和 Xcode 6 Beta。

你们中有人知道该怎么办吗?

最佳答案

我通过 bitnami 安装 mysql 时遇到了同样的问题,看起来你没有所有必需的 mysql 库。

我用了brewsh并通过

重新安装 mysql
brew install mysql

sudo gem install mysql2

您还需要在主目录的 .profile 文件中加载动态库,您可以通过在 .profile 文件中添加这些行来实现。

export PATH=$PATH:$MYSQL
export DYLD_LIBRARY_PATH=/Applications/mysql/lib:$DYLD_LIBRARY_PATH

在上面两行代码中

/Applications/mysql/lib,是你的mysql库的安装路径,在你的可能不同,请根据你的环境检查和使用

关于安装 OSX Yosemite 和 Xcode 6 后出现 Ruby gem 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24113251/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com