Why would `rvm install ruby-2.1.0` install preview1? - ruby

I just tried to install Ruby 2.1, and instead got 2.1 Preview 1. This seems crazy to me. 2.1 is out. Why would RVM assume that when I say rvm install ruby-2.1.0 that I really mean rvm install ruby-2.1.0-preview1? Why would it not match the exact version I specified, instead of one which begins with that substring?

Silly clarification question (and I would post it as a comment if I had enough reputation), but have you updated RVM lately?
rvm get stable (or if you want to live on the edge, rvm get head) would, I expect, update the internal list of released ruby versions.

Make sure you are running the latest version. RVM 1.25.8 (or greater) is working as expected.
$ rvm get latest
Downloading https://github.com/wayneeseguin/rvm/archive/1.25.8.tar.gz
and
$ rvm install 2.1
Searching for binary rubies, this might take some time.
...
ruby-2.1.0 - #downloading ruby-2.1.0, this may take a while depending on your connection...
and
$ rvm use 2.1
Using /Users/weppos/.rvm/gems/ruby-2.1.0
$ ruby --version
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]

Related

How to know the lastest version of ruby in Terminal?

I intend to install ruby by rvm to my Macbook Pro, with the command tutorial:
$ rvm requirements
$ rvm install 2.3.0
$ rvm use 2.3.0 --default
But you know the 2.3.0 maybe not the newest version, because the tutorial is long time ago.
So, how can I get the lastest version of ruby in command?
rvm get head # update list of known rubies. Necessary if your local list is out of date.
rvm install ruby --latest # install the latest ruby
The latest ruby version (at time of writing) is 2.4.0
you can run rvm list known to see all options, but 2.3 is pretty new and will be a good choice.

rvm determine and install latest version of ruby

So far I only know how to do commands like
rvm 2.0.0
Fortunately Google tells me
The current stable version is 2.0.0-p247.
But shouldn't I be able to use rvm to do that step for me? I can't figure out how to just tell rvm to install the latest version of ruby, without manually specifying it.
it is enough to:
rvm get stable
rvm use ruby --install --default
it will update rvm, check for latest ruby - install it if missing - and set as default
I don't know of a way to have rvm just install the latest version automatically, but here's three simple commands using just rvm:
rvm reload
rvm list known # This will show all the available versions, including the latest
rvm install <latest_version> # Replace <latest_version> with the latest shown by the last command
rvm install ruby-head should install the last known version.

Why does rvm install ruby not work?

It is said on the Rails 3.2.9 blog that Ruby 1.9.3-p327 is recommended to be installed. But
rvm install ruby-1.9.3-p327
actually gives an error, and the log says:
There is no checksum for
'http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.bz2' or
'ruby-1.9.3-p327.tar.bz2', it's not possible to validate it. If you
wish to continue with unverified download add '--verify-downloads 1'
after the command.
But I checked http://ftp.ruby-lang.org/pub/ruby/1.9/ and the ruby-1.9.3-p286 has the same files as the p327. So where is the checksum located? Is it inside of the .bz2 file? So how should we install p327, is it just by
rvm install 1.9.3-p327 --verify-downloads 1
and is there security concerns, or are there other methods to install it safely?
First thing, make sure that your rvm version knows about this version by running rvm list known
On my machine, when I ran it the first time I got the following output for known MRI Rubies:
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7-p370
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-[p286]
[ruby-]1.9.3-head
ruby-head
So my version of rvm only knew about 1.9.3-[p286] as the most recent version 1.9.3 version.
I got the latest version of rvm with the following command:
$ rvm get stable
After that, the list of known MRI rubies was as follows:
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7-p370
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-[p327]
[ruby-]1.9.3-head
[ruby-]2.0.0-preview1
ruby-head
A related thread on the rvm googlegroups discussion forum
In ubuntu 12.04, I use the cmd as follows, the newest version "-p327" will automatically detected and installed:
rvm install 1.9.3
The guide Installing Rails on Ubuntu 12.04 with RVM support may helps:

RVM - Do I need Ruby 1.8.7 in order to install Ruby 1.9?

I just need some clarification on a line I read after running rvm requirements. It says
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head), then you
must install and use rvm 1.8.7 first.
Does this mean RVM version 1.8.7 or Ruby version 1.8.7? I'm currently running RVM version 1.10.2 with no gems installed, but I want to only install 1.9.3. Thanks!
Just looking at the most recent revision of that part of RVM, it seems like you get that message automatically. It's targeted at *nix users so I can't check it currently, but all such users should get that message from rvm requirements. It's been there since last September, and it's not a warning that you haven't met a dependency. (Note that it also says bash, curl, git and patch are required, and you likely have those, too.)
In any case, it's referring to the RVM version, which for you is two minor versions ahead. It's an understandably confusing message as 1.8.7 is also a fairly widespread version of Ruby.
This means RVM version 1.8.7, not Ruby 1.8.7.

How do I update Ruby-interpreters with RVM?

I installed RVM with a few versions of Ruby-interpreters some time ago.
How I can to update it, because new versions are already released?
I found only one way: rvm install 1.9.2-rc1 && rvm remove 1.9.2-preview1, but my gems are lost.
Can I update branches time to time? I haven't found any tips in the documentation.
Use the rvm upgrade 1.9.2-preview1 1.9.2-rc1 command or watch this screencast
[Edit: rvm has a new command to upgrade-- you likely want to use the answer by andy318]
AFAIK, there is no automatic way to do this at the moment, but something like this enables you to keep your gems:
rvm use 1.9.2-preview1
rvm gemset export
rvm install 1.9.2-rc1
rvm use 1.9.2-rc1
rvm gemset import
rvm remove 1.9.2-preview1
Now, for automating updates, you would have to detect version changes, that is easy, as you can simply use the return value of rvm use 1.9.2. Finding out what the new version is (1.9.2-rc1) is unnecessary, as it is aliased as 1.9.2. The trick is to find the latest installed version of 1.9.2. You could do something like this in a cron job:
# make sure you source rvm first
rvm update --head
rvm reload
if [ ! rvm use 1.9.2 ]; then
for ruby_version in `rvm list strings`; do
# find the latest version of 1.9.2
case $ruby_version in
ruby-1.9.2-*) latest192=$ruby_version;;
esac
done
rvm use $latest192
rvm gemset export 192.gems
rvm install 1.9.2
rvm use 1.9.2
rvm gemset import 192
rvm remove $latest192
fi
Did not try that, but I have similar code in my update script. I also slipped in a gem update and other stuff.
Feel free to visit the #rvm IRC channel on Freenode.
Current rvm version provides an easier way to do this. The 'upgrade' option will migrate gem sets, wrappers and environment files -
$ rvm upgrade 1.9.2-p136 1.9.2-p180
To find out if there is a more recent stable version of a ruby implementation for you to upgrade to, first get the latest version of RVM and then enumerate the known versions of Ruby.
$ rvm get stable
$ rvm list known
You can compare this the ruby versions installed on your system
$ rvm list rubies
you can install latest rvm and ruby by :
$ \curl -L https://get.rvm.io | bash -s stable --ruby
and check all the ruby version with stability
$ rvm list known
can also check details here : http://www.ruby-lang.org/en/downloads/
$ rvm install ruby 2.0.0-p247
Use when you want to download specific version or know this is stable.
There's a fantastic RVM GUI called JewelryBox that I use to manage my Ruby versions
http://jewelrybox.unfiniti.com
I think that is:
rvm all do gemset update

Resources