El Capitan Ruby二进制文件安装问题

时间:2016-05-10 16:48:00

标签: ruby-on-rails ruby rvm homebrew rake-test

试图通过Hartl rails教程的某些部分来熟悉rails框架。我安装了自制软件(删除并重新安装它,因为它在使用El Capitan后给我带来了麻烦),并获得了一个带有rvm get stable的新版rvm

我进入了包含该项目的目录,我收到了此消息

ruby-2.3.0-dev is not installed.
To install do: 'rvm install ruby-2.3.0-dev'

以前,我尝试使用2.3.0作为最新版本(这是我运行rvm list时出现的最新信息,不知道为什么),但现在我想将其更改为2.3 0.1。有谁知道如何更改这个项目的ruby版本?

此外,当我运行rvm install ruby-2.3.1时,我收到此错误

No binary rubies available for: osx/10.11/x86_64/ruby-2.3.1.

这导致我尝试重新安装自制程序,更新我的rvm等版本。我尝试了所有这些并且仍然收到此错误消息。

发生这种情况的全部原因是因为我尝试用

执行测试
$ bundle exec rake test

我收到了这条消息

RubyDep: WARNING: Your Ruby is outdated/buggy. (To disable warnings, set RUBY_DEP_GEM_SILENCE_WARNINGS=1)
RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.

Haven无法安装2.3.1,我只是在这里失去理智。

编辑 - 是否建议直接从源代码安装而不是使用二进制文件?

1 个答案:

答案 0 :(得分:2)

我已经在运行OS X El Capitan的Mac笔记本电脑中重现了您的步骤。执行命令rvm install 2.3.1我得到了与你相同的错误,但在此之后rvm继续执行命令并最终下载并安装了Ruby 2.3.1的二进制文件。我的输出是这样的:

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-2.3.1, this may take a while depending on your cpu(s)...
ruby-2.3.1 - #downloading ruby-2.3.1, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.7M  100 13.7M    0     0  5854k      0  0:00:02  0:00:02 --:--:-- 5855k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.1 - #extracting ruby-2.3.1 to /Users/user/.rvm/src/ruby-2.3.1....
ruby-2.3.1 - #configuring...........................................................
ruby-2.3.1 - #post-configuration.
ruby-2.3.1 - #compiling.............................................................
ruby-2.3.1 - #installing.........
ruby-2.3.1 - #making binaries executable..
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.3.1 - #gemset created /Users/user/.rvm/gems/ruby-2.3.1@global
ruby-2.3.1 - #importing gemset /Users/user/.rvm/gemsets/global.gems...............................................
ruby-2.3.1 - #generating global wrappers........
ruby-2.3.1 - #gemset created /Users/user/.rvm/gems/ruby-2.3.1
ruby-2.3.1 - #importing gemsetfile /Users/user/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.1 - #generating default wrappers........
ruby-2.3.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.1 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri

之后我执行了rvm use 2.3.1ruby -v,最后一个命令的输出是:

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

所以我可以在Mac OS X El Capitan上成功安装Ruby 2.3.1。如果这无法帮助您解决问题,请提供进一步的信息。