使用RVM在Mac上安装Ruby时出错

时间:2013-12-31 16:28:23

标签: ruby macos rvm

我是Ruby的新手,我在运行Mountain Lion操作系统的Mac上安装它时遇到问题...任何帮助都会很棒!!!

我已经按照教程,我已经安装了GIT,curl和RVM。下一步是安装Ruby,我试过但是我收到了以下错误

$ rvm install 1.9.2
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.2-p320.
It is not possible to build movable binaries for rubies 1.8-1.9.2, but you can do it for your system only.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing macports............
Error running 'requirements_osx_port_install_port',
showing last 15 lines of /Users/mikelgainza/.rvm/log/1388506081_ruby-1.9.2-p320/port_install.log
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking objc/objc.h usability... yes
checking objc/objc.h presence... yes
checking for objc/objc.h... yes
checking if linking libobjc requires pthreads... no
checking for Apple Objective-C runtime... yes
checking for GNU Objective C runtime... no
configure: Using Apple Objective-C runtime
checking for Apple Foundation library... no
configure: WARNING: GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library
configure: error: Could not find a working Foundation implementation
Requirements installation failed with status: 1.

我也试过安装2.1.0。它找到了遥控器,但后来却出现了一些错误

Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/osx/10.8/x86_64/ruby-2.1.0.tar.bz2
Checking requirements for osx.
Installing macports............
Error running 'requirements_osx_port_install_port',
showing last 15 lines of /Users/mikelgainza/.rvm/log/1388512995_ruby-2.1.0/port_install.log
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking objc/objc.h usability... yes
checking objc/objc.h presence... yes
checking for objc/objc.h... yes
checking if linking libobjc requires pthreads... no
checking for Apple Objective-C runtime... yes
checking for GNU Objective C runtime... no
configure: Using Apple Objective-C runtime
checking for Apple Foundation library... no
configure: WARNING: GNUSTEP_SYSTEM_ROOT is not defined in your environment, preventing the use of GNUstep's Foundation library
configure: error: Could not find a working Foundation implementation
Requirements installation failed with status: 1.

知道我做错了什么?

谢谢!

4 个答案:

答案 0 :(得分:1)

首先,您需要从Mac App Store安装Apple Developers Toolkit(XCode)(它是免费的)

安装完成后,您需要运行以下命令来安装CLI命令行实用程序:

xcode-select --install

然后再次尝试安装,它应该适合你。

此外,您可能希望安装最新版本的Ruby,在撰写本文时2.1.0(通过rvm install 2.1.0

最后,如果您还没有,我建议您同时安装homebrew,因为这样可以检查您的运行时环境是否存在错误(通过brew doctor)。您可以在此处找到相关说明:http://brew.sh/

祝你好运!

答案 1 :(得分:1)

我遇到过类似的问题

SELECT name 
  FROM Staff s
  JOIN Room r ON (r.StaffNumber = s.StaffID)
  JOIN Module m ON (m.Modulecode = r.ModuleID)
  WHERE m.Moduletitle = 'Website Production';

正如Jekyll's Doc所述, 我安装Xcode命令行工具

  

安装Xcode命令行工具   如果您在安装使用本机扩展并使用macOS的Jekyll依赖项时遇到问题,则需要安装Xcode及其附带的命令行工具。在首选项→下载→组件中下载它们。   并在安装xcode-select:

之后
➜  ~ rvm install 2.3.0
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.12/x86_64/ruby-2.3.0.tar.bz2
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
Error running 'requirements_osx_brew_update_system ruby-2.3.0',
showing last 15 lines of /Users/admin/.rvm/log/1481339734_ruby-2.3.0/update_system.log
+rvm_error:2> rvm_pretty_print stderr
+rvm_pretty_print:2> case auto (0|no)
+rvm_pretty_print:2> case auto (1|auto)
+rvm_pretty_print:7> case xterm-256color (dumb|unknown)
+rvm_pretty_print:10> case stderr (stdout)
+rvm_pretty_print:10> case stderr (stderr)
+rvm_pretty_print:12> [[ -t 2 ]]
+rvm_pretty_print:12> return 1
+rvm_error:4> printf %b 'Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
+requirements_osx_brew_update_system:25> return 1
Requirements installation failed with status: 1.

然后我成功安装了ruby 2.3.0。

xcode-select --install

答案 2 :(得分:0)

Error running 'requirements_debian_update_system ruby-2.5.1',
please read /home/ivliev/.rvm/log/1525444837_ruby-2.5.1/update_system.log
Requirements installation failed with status: 1.

决定:

sudo apt-get update

删除掉落的软件包,然后再次运行它

查看可用的包

rvm list known
如果有必要,没有。更新包列表

rvm get master 

安装所需的红宝石

rvm install "ruby-2.5.1"

答案 3 :(得分:0)

我遇到了同样的错误-对我来说,这是Homebrew的问题-命令日志的最后几行说:

++ printf %b 'Failed to update Homebrew, follow instructions here:
    https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'

因此,我运行了brew update,然后给了我另一条错误消息,其中包含有关如何修复它的说明。在按照brew的说明进行操作之后,我就能够安装Ruby。