【问题标题】:What values for RUBY_ENGINE correspond to which Ruby implementations?RUBY_ENGINE 的哪些值对应于哪些 Ruby 实现?
【发布时间】:2014-09-27 05:22:53
【问题描述】:

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

$ ruby -e 'puts RUBY_ENGINE'
ruby

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

【问题讨论】:

    标签: ruby jruby macruby rubinius


    【解决方案1】:

    这是我目前发现的:

    | 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 向 Ujihisa 提供的道具具有最多的价值。 其他人是通过阅读thisthis 找到的。从 * 上的其他答案中收集了更多价值。为所有做出贡献的人提供更多道具!

    【讨论】:

      【解决方案2】:

      还有:

      | RUBY_ENGINE | Implementation    |
      |:-----------:|:------------------|
      | "ruby"      | REE               |
      | "maglev"    | MagLev            |
      

      【讨论】:

        最近更新 更多