ruby - RUBY_ENGINE 的哪些值对应于哪些 Ruby 实现?

标签 ruby jruby macruby rubinius

我所知道的在运行时检测 Ruby 实现(例如 MRI、JRuby、Rubinius 等)的方法是检查全局常量 RUBY_ENGINE:

$ ruby -e 'puts RUBY_ENGINE'
ruby

什么是已知 Ruby 实现及其对应的 RUBY_ENGINE 值的合理全面列表?

最佳答案

这是我目前发现的:

| RUBY_ENGINE | Implementation    |
|:-----------:|:------------------|
| <undefined> | MRI < 1.9         |
| 'ruby'      | MRI >= 1.9 or REE |
| 'jruby'     | JRuby             |
| 'macruby'   | MacRuby           |
| 'rbx'       | Rubinius          |
| 'maglev'    | MagLev            |
| 'ironruby'  | IronRuby          |
| 'cardinal'  | Cardinal          |

上述 Ruby 实现的链接:

支持宇治久 this blog entry哪个有最多的值(value)。 其他的是通过阅读找到的thisthis .从 StackOverflow 上的其他答案中收集了更多的值。为所有做出贡献的人提供更多 Prop !

关于ruby - RUBY_ENGINE 的哪些值对应于哪些 Ruby 实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9894168/

相关文章:

iphone - 使用 MacRuby 开发 iPhone 应用程序

mysql - 如何将行转换为重复的基于列的数据?

ruby - 在instance_eval中定义方法

ruby-on-rails - Ruby:加入哈希键

java - 如何在 jruby 中使用 java.util.properties?

ruby - 如何告诉一个 gem 不要安装在 JRuby 上?

ruby-on-rails - Ruby on Rails - 将字符串转换为 DateTime 操作

java - Netbeans 不会在调试器中拾取 Java 类

cocoa - 为什么我的 Macruby 指针无法作为 void 指针传递?

cocoa - 将 CFStringRef 指针传递给 MacRuby 中的 C 函数