How install ruby 2.1.0 on OS_X 10.9 using rvm? ( No binary rubies available for: osx/10.9/x86_64/ruby )

怎甘沉沦 提交于 2019-12-10 10:13:26

问题


I'm trying to install ruby 1.9.3-p545 or ruby-2.1.0 or ruby-2.1.1, but it fails...

My environment:

  • OS_X 10.9 x86_64
  • rvm 1.25.20

Error from terminal:


bmalets$ rvm install 1.9.3-p545
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p545.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_port.
Installing macports......................................................bmalets password required for 'make install': 
......................
Installing requirements for osx_port.
Updating system............
Error running 'requirements_osx_port_update_system ruby-1.9.3-p545',
showing last 15 lines of /Users/bmalets/.rvm/log/1394647562_ruby-1.9.3-p545/update_system.log
checking Mac OS X version... 10.9.2
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 5.0.2
checking for gcc... /usr/bin/llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
shell command "cd /opt/local/var/macports/sources/rsync.macports.org/release/base && CC=/usr/bin/llvm-gcc-4.2 ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make && make install" returned error 77
DEBUG: Error installing new MacPorts base: shell command failed (see log for details)
    while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)
++ return 1
++ return 1
Requirements installation failed with status: 1.

Please help.

P.S. I tried to update my command line tools, it fails too:

I tried to update ports: sudo port -v selfupdate, and it ask me for command line tools :)


bmalets$ sudo xcode-select --install
xcode-select: note: install requested for command line developer tools

回答1:


Well, I got the similar problem. And I finally solved it even though I was not sure about the details... T_T

  1. download the latest Command Line Tools manually from https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-

  2. instal Homebrew

  3. run rvm requirements, and it will download some packages automatically

  4. WORK!




回答2:


Based on the fact that the compiler does not work, I checked if /usr/bin/llvm-gcc-4.2 existed. It did not, but there was an alias /usr/bin/llvm-gcc. So I duplicated the alias /usr/bin/llvm-gcc to: /usr/bin/llvm-gcc-4.2 (This alias points to: /usr/bin/clang)

After that running rvm requirements managed to install the MacPorts.




回答3:


I had the exact same issue as OP. After updating command line tools and restarting terminal, I followed Bjinse's comment to install mac ports by copying the file and running

$rvm requirements
(not sure if copying the file was necessary)

then

$rvm install 1.9.3

Finally worked. Having a ruby installed under

$rvm list

I could then then

$rvm upgrade 1.9.3p545 ruby 2.1.1




回答4:


If you get an error with this, where the terminal says "RVM is not a function":

$ rvm use 1.9.3

Do this:

You need to run the follow

user$ source ~/.rvm/scripts/rvm

then run this

user$ type rvm | head -n 1

and if you get

rvm is a function

The problem is solved.

Took from here



来源:https://stackoverflow.com/questions/22360825/how-install-ruby-2-1-0-on-os-x-10-9-using-rvm-no-binary-rubies-available-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!