my macbook is OSX El Capitan. It has Apple pre-installed universal Ruby version 2.0.0.
Now, I want to use latest Ruby 2.3.0. I managed to use rvm to install Ruby 2.3.0. I see the following message after rvm finished installing ruby 2.3.0:
Ruby was built without documentation, to build it run: rvm docs generate-ri
/Users/John/.rvm/bin/rvm: line 66: shell_session_update: command not found
Creating alias default for ruby-2.3.0...
* To start using RVM you need to run `source /Users/John/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
I followed this message, & run command
source /Users/John/.rvm/scripts/rvm
but when I run ruby -v, the version is still Apple pre-installed Ruby 2.0.0. How can I switch to the ruby I installed through rvm?
(under path .rvm/rubies I can find ruby-2.3.0)
To switch to using 2.3.0, do
rvm use 2.3.0
To make it default, do
rvm use --default 2.3.0
Related
I am trying to upgrade Ruby because I need to setup a Jekyll template, and I need to latest version to do it. Since I have a Mac running Sierra, I already have Ruby preinstalled as well as the Homebrew installation. When I install it using brew install ruby, it works, but when I check the version, it is still at 2.0.0 instead of 2.3.1 where it should be. Homebrew says I have 2.3.1, but the CLI says I have 2.0.0. I tried to use brew link --override ruby to make it work, but it said everything was working and it got me nowhere.
Use rbenv and plugin ruby-build. It will keep several versions of ruby on the one machine.
After install go to directory with your code, run rbenv install 2.3.1 and create file .ruby-version containing 2.3.1. All scripts running from this directory will use ruby 2.3.1.
Or you will able to set ruby version for all running scripts - rbenv global 2.3.1
I am on a Mac running OSX 10.11 El Capitan. I installed Ruby 2.3.1 via rvm. If I type in the terminal
ruby --version
It says that I am running 2.0.0
But if I type
rvm use 2.3.1
And then
ruby --version
It says that I am running 2.3.1
But next time I open terminal it goes back to 2.0.0
How can I use latest version of Ruby by default?
rvm --default use 2.3.1
Documentation here.
Make a .ruby-version file in a directory of your project and in it put ruby-3.2.1 or which ever version you want
Just trying to update to the latest version of Ruby. On ruby-lang.org/en/documentation/installation/#homebrew, I found that you should be able to do it via homebrew:
brew install ruby
However, when I listed the ruby version (ruby -v) after it 'updated' it was still at the old version 2.0.0.
Hermes:~ Sancho$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
I happened to list the contents of /usr/local/bin/ and I could see a symbolic link:
ruby -> ../Cellar/ruby/2.2.1/bin/ruby
So, I don't know what's happening and why the version still lists the old number and not 2.2.1, as it looks like it should.
There are sym links to for various other ruby tools (erb, gem, irb, rake, rdoc, ri) to version 2.2.1 also.
So what is happening here and how do I correctly install version 2.2.1?
I do have RVM installed also, but I want to update the system version of ruby to the latest.
Easy step
brew uninstall ruby # (if installed)
brew install ruby
then copy the path and paste into the terminal and restart the terminal
check ruby --version
Use Homebrew but make sure /usr/local/bin is early in your path. Ex:
.bashrc
export PATH=/usr/local/bin:$PATH
This will not update the system Ruby version. Instead it will install another version of ruby and this line tells bash to look for the new version instead.
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
$PATH doesn't change in current Terminal session. So please close the Terminal and reopen.
Ref: Jekyll on macOS
I'm a total newbie when it comes to using Terminal, so I don't really understand what's happening here when I try to upgrade my ruby version (1.8.7) with rvm on a Mac OS X 10.7.3.
When I input
rvm install current && rvm use current
I get this
system
system
What does this mean? And how can I proceed with the installation of the latest version?
The current rvm command outputs the name of the currently active installation of Ruby; in this case, it's using your system's pre-installed Ruby (1.8.7).
Try this:
rvm install 2.0 # (or whatever version you need)
rvm use 2.0 --default # this sets the default to the 2.0 install
I'm trying to install Ruby version 2.0.0 using RVM. I'm trying to use the Rails installer (railsinstaller.org).
I have downloaded the package and ran the installer and I have also restarted all terminal windows.
Here is the issue I am encountering:
my terminal http://img822.imageshack.us/img822/9704/stacks.png
As you can see, it says that RVM installed Ruby version 2.0.0. When I try to tell RVM to use this version it says that it is not installed.
Looks like it may have been fixed. Try rvm get head and then try again: https://github.com/wayneeseguin/rvm/issues/1832