Hello I am currently using RVM version 1.29.3 and Ruby 2.4.2 and I am unable to upgrade to 2.4.3 or 2.5.0. When I run rvm upgrade 2.5.0, output is Are you sure you wish to upgrade from ruby-2.4.2 to ruby-2.4.1? (Y/n): which is obviously not what I want.
Often, new releases of Ruby are not available on stable versions of rvm, and if you want them you need to install the head. As previously stated, you can do rvm get head. New windows will use the new version of rvm but if you use a terminal window that was loaded before installing the new version of rvm, you'll need to do a rvm reload.
Then you should be able to rvm install 2.5.
(Do not then do rvm get stable because it will overwrite the head version.)
Related
I am using zsh and ruby version 2.3.1.
I would like to upgrade it to 2.5.0. I tried to install rvm and ruby version 2.5.0; they were installed, but it also caused many problems because it wasn't able to find other gems.
I removed rvm, and it was back to the way it used to be.
I was wondering if there's a way to upgrade ruby withour rvm. I don't know how ruby was installed before.
When I type which ruby, I get /Users/myname/.rbenv/shims/ruby
Looks like you are using rbenv to manage ruby versions. You can type the following command to install ruby 2.5.0
rbenv install 2.5.0
After that, change your default ruby version to 2.5.0 by typing
rbenv global 2.5.0
For more information and commands, check out the docs.
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.
My current Ruby version is 2.2.3 and I want to upgrade it to 2.3.0.
I use rbenv using this guide: gorails.com/setup/ubuntu/16.04
How do I upgrade my Ruby version? And when I upgrade, does it affect anything that I need to be aware of?
This answer had been written to address the original question, which did not specify rbenv as a preferred approach. Although the question changed after this answer was written, the answer has been retained to help users that may be using RVM to upgrade/manage their Ruby installations.
See the rbenv answer for details on using rbenv for the same purpose.
Use RVM or another Ruby version manager. This is far superior to installing a new system Ruby in most cases.
If you're upgrading your system Ruby, you have a number of things to keep in mind:
what other dependencies are there on that Ruby version?
are all of the gems going to be available after upgrade?
which applications are using the existing Ruby version and what can/will break after upgrade?
are there any other users using the existing Ruby that need to be aware of (and prepare for) the change?
With a Ruby version manager, you eliminate most of these concerns. You can run multiple Ruby versions on the same machine, which gives you the ability to test backward and forward compatibility. It also lets you experiment with the newer Ruby versions to make sure that they're fully stable for use.
You can install RVM using this method from any bash shell:
\curl -sSL https://get.rvm.io | bash -s stable
or update it to the most recent stable version by using:
rvm get stable
Once RVM is installed (or updated), you can install any Ruby version you choose, by doing the following:
rvm install 2.3.0
or upgrade from one version to another:
rvm upgrade 2.2.3 2.3.0
You can see which Ruby versions are installed by using this:
rvm list
You can also check to see which versions of Ruby that you can install on RVM by using this command:
rvm list known
Switch to a specific installed Ruby version by using the use command:
rvm use 2.3.0
and then switch back to an older version when you need to:
rvm use 2.2.3
Check out the RVM documentation for more features. You'll be surprised at how useful RVM actually is. There's a whole lot more to it than just what's shown here.
To upgrade your Ruby version using rbenv, you can use these steps. Some will only be necessary based on your environment. Plugins are an important aspect of this, if you have any installed.
Update rbenbv
First, you'll want to make sure that your rbenv version is updated. If you have the update plugin installed, you can update rbenv and all installed plugins using a single command:
rbenv update
Using the update plugin is highly recommended. However, if you are not using the update plugin, you can manually update rbenv in this way:
cd ~/.rbenv
git pull
Update plugins
If you have manually updated rbenv, you'll also need to update the plugins manually, as well. Make sure to follow the update instructions for each plugin.
One plugin that's very important to update at this point (if you have it installed) is the ruby-build plugin, which provides build support for Ruby under rbenv. This may improve the experience installing a new Ruby version in the next step.
Install Ruby version
After you have updated rbenv, you can install the new Ruby version:
rbenv install -v 2.3.0
Remove Ruby version
rbenv will allow you to manage and use multiple Ruby versions on a single machine. This is a huge benefit. However, if you no longer want the older Ruby version installed, you can remove it like this:
rbenv uninstall 2.2.3
Note that you can always re-install the Ruby version after uninstalling it, and use rbenv to manage the versions separately. This is good practice when working with multiple projects.
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.
I use a very old ruby 1.8.7 which is installed only very old RVM 1.6.9, and I would like to install a new Ruby but my RVM only knows about Ruby 1.9.2 version. I would like to put a new version of the RVM kept the old one, but there is a conflict. Please tell me how to put a new version of Ruby without deleting the old one?
p.s. I installed rvm from ubuntu repositories
You are using old and broken (by Ubuntu) package of RVM, please use this instructions to update https://stackoverflow.com/a/9056395/497756
Why don't you simply update your rvm? You can do this by
rvm update --head
or
rvm get head --auto
According to your RVM version.