无法在新的Macbook Air Mac OS X 10.9.4上使用rbenv安装ruby版本 [英] Can't install a ruby version with rbenv on new Macbook Air mac osx 10.9.4

查看:108
本文介绍了无法在新的Macbook Air Mac OS X 10.9.4上使用rbenv安装ruby版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我购买了新的Macbook Air(2014年7月),并且试图还原一些用Rails构建的项目.

I bought a new Macbook Air (July 2014) and I'm trying to restore some projects built with Rails.

唯一真正的Ruby是System Ruby.

The only actual Ruby is the System one.

  • OSX 10.9.4
  • 已安装Cxode:xcode-select版本2333.
  • 自制0.9.5
  • rbenv 0.4.0
  • ruby​​-build 20140702

当我尝试安装最后一个ruby(2.1.2)时,我的堆栈跟踪:

My Stack trace when I try to install the last ruby (2.1.2):

rbenv install 2.1.2                         
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635
Installing ruby-2.1.2...
mkdir: /usr/local/bin/rbenv/versions/2.1.2/lib: Not a directory

BUILD FAILED

Inspect or clean up the working tree at /var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715154952.19296
Results logged to /var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715154952.19296.log

Last 10 log lines:
x ruby-2.1.2/insns_info.inc
x ruby-2.1.2/vm.inc
x ruby-2.1.2/thread.c
x ruby-2.1.2/regcomp.c
x ruby-2.1.2/encdb.h
x ruby-2.1.2/GPL
x ruby-2.1.2/vmtc.inc
x ruby-2.1.2/probes_helper.h
x ruby-2.1.2/ruby_atomic.h
/var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715154952.19296/ruby-2.1.2 /var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715154952.19296 ~/Sites/my_project
rm: /usr/local/bin/rbenv/versions/2.1.2: Not a directory

当我尝试安装最后一个修补的ruby 2.0.0时,我的堆栈跟踪(以替换系统中的p451而不是p481):

My Stack trace when I try to install the last patched ruby 2.0.0 (to replace the system one which is p451 instead of p481):

rbenv install 2.0.0-p481    
Downloading ruby-2.0.0-p481.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/00dd3d72435eb77f2bd94537c1738e5219ca42b6d68df3d4f20c183f4bd12d0f Installing ruby-2.0.0-p481...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715155606.19406 
Results logged to /var/folders/s_/8fwdv8c52q12dy5dd69xjc2r0000gn/T/ruby-build.20140715155606.19406.log

Last 10 log lines:  from ./tool/rbinstall.rb:192:in `makedirs'  
  from ./tool/rbinstall.rb:296:in `prepare'     
  from ./tool/rbinstall.rb:335:in `block in <main>'     
  from ./tool/rbinstall.rb:774:in `call'    
  from ./tool/rbinstall.rb:774:in `block (2 levels) in <main>'  
  from ./tool/rbinstall.rb:771:in `each'    
  from ./tool/rbinstall.rb:771:in `block in <main>'     
  from ./tool/rbinstall.rb:767:in `each'    
  from ./tool/rbinstall.rb:767:in `<main>' 
make: *** [do-install-all] Error 1 
rm: /usr/local/bin/rbenv/versions/2.0.0-p481: Not a directory

更多配置详细信息:

brew list
autoconf    gettext     git     openssl     ossp-uuid   pkg-config  postgresql  rbenv       readline    ruby-build  sip

Rbenv& Sytem的Ruby版本:

Rbenv & Sytem's Ruby version:

rbenv versions
* system (set by /usr/local/Cellar/rbenv/version)

ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

我的.zshrc的结尾:

The end of my my .zshrc:

export PATH=~/.rbenv/shims:$PATH
# Set up rbenv for Homebrew. Make sure path is BEFORE Homebrew's /usr/local/[s]bin
#To enable shims and autocompletion add to your profile:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

eval "$(rbenv init -)"

source ~/.profile

我的.profile的结尾:

And the end of my .profile:

# export RBENV_ROOT=/usr/local/bin/rbenv
export RBENV_ROOT=/usr/local/Cellar/rbenv/

我尝试了这个方法: rbenv安装ruby构建失败,但是没有任何改变.

I tried this : rbenv install ruby BUILD FAILED but it didn't change anything.

有什么想法吗?

推荐答案

为开发工具卸载XCode无效.

Uninstalling XCode for dev tools didn't work.

使用brew链接openssl --force无效.

Using brew link openssl --force didn't work.

将CONFIGURE_OPTS与openssl一起使用不起作用.

Using the CONFIGURE_OPTS with openssl didn't work.

但是RUBY_CONFIGURE_OPTS起作用了:

But RUBY_CONFIGURE_OPTS worked :

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1h" rbenv install 2.1.2

YEAH BABY!

YEAH BABY !

这篇关于无法在新的Macbook Air Mac OS X 10.9.4上使用rbenv安装ruby版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆