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

El Capitan Ruby binaries installation issue

只是想通过 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.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.

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

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

我已经在我的 Mac 笔记本电脑 运行 OS X El Capitan 中复制了您的步骤。执行命令 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。如果这不能帮助解决您的问题,请提供进一步的信息。