简体   繁体   English

Ruby版本1.9.3与2.0.0

[英]Ruby version 1.9.3 vs 2.0.0

I'm following Michael Hartl's Ruby tutorial book and the book says I should have Ruby 2.0.0 version. 我正在关注Michael Hartl的Ruby教程书,书中说我应该有Ruby 2.0.0版本。 Since I have Ruby 1.9.3 version, I've tried various ways but it seems like I can't upgrade it to Ruby 2.0.0 version. 由于我具有Ruby 1.9.3版本,因此我尝试了各种方法,但似乎无法将其升级到Ruby 2.0.0版本。 Is it okay if I work code with Ruby 1.9.3 version and Rails 4.0.2? 如果我使用Ruby 1.9.3版本和Rails 4.0.2编写代码,可以吗?

Is it possible to have multiple Ruby or Rails versions within a computer? 一台计算机上可以有多个Ruby或Rails版本吗? If so, how can that be achieved? 如果是这样,那将如何实现?

Thank you! 谢谢!

  1. Take a look at: https://rvm.io/ Thanks to this tool you have ability to awesome things with ruby versions. 看一看: https ://rvm.io/借助此工具,您可以使用ruby版本实现出色的功能。 To have multiple versions of RoR you can use: http://rvm.io/gemsets 要具有多个版本的RoR,可以使用: http : //rvm.io/gemsets

  2. Sure, RoR 4.x is fully compatible with Ruby 1.9.3 当然,RoR 4.x与Ruby 1.9.3完全兼容

Yes, it is possible to use multiple versions of Ruby on one machine using RVM https://rvm.io/ . 是的,可以使用RVM https://rvm.io/在一台计算机上使用多个版本的Ruby。 (alternatively, try rbenv https://github.com/sstephenson/rbenv ). (或者,尝试rbenv https://github.com/sstephenson/rbenv )。

Perhaps you've installed 2.0.0 correctly with RVM, but you just aren't using the correct Ruby? 也许您已经使用RVM正确安装了2.0.0,但是您使用的不是正确的Ruby? Check RVM's setup with: 使用以下命令检查RVM的设置:

rvm current

That should output a string that begins with the version of Ruby that RVM is using. 那应该输出一个以RVM使用的Ruby版本开头的字符串。 To change to using to 2.0.0 : 更改为using 2.0.0:

rvm use 2.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但您的Gemfile指定为2.0.0 - Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 如何修复“您的 Ruby 版本是 1.9.3,但您的 Gemfile 指定了 2.0.0” - How to fix "Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0" 安装ruby2.0.0后,仍然显示“您的Ruby版本是1.9.3” - After installing ruby2.0.0 it still says “Your Ruby version is 1.9.3” 在RubyMine中:“您的Ruby版本是2.0.0,但是您的Gemfile指定了1.9.3(Bundler :: RubyVersionMismatch)” - In RubyMine: “Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)” 更新Ruby 1.9.3-> 2.0.0而不会丢失gem - Updating Ruby 1.9.3 -> 2.0.0 without losing gems 如何将应用程序从Ruby 2.0.0降级到1.9.3 - How to downgrade application from Ruby 2.0.0 to 1.9.3 大虾需要红宝石1.9.3版 - Prawn requires ruby version 1.9.3 升级到Ruby版本2.1.2,乘客仍在1.9.3 - Upgraded to Ruby version 2.1.2, passenger still on 1.9.3 需要安装Mongify,Ruby版本> = 1.9.3 - Installing mongify, ruby version >= 1.9.3 required 无法在Ruby 1.9.3上安装SQLite3 gem,Ruby 2.0.0则没有问题。 有什么不同? - Unable to install SQLite3 gem on Ruby 1.9.3, no issues with Ruby 2.0.0. What's the difference?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM