(Mac Terminal) "System" message when trying to install latest ruby with RVM - ruby

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

Related

switch to ruby version installed through RVM

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

How can I use the latest version of Ruby by default?

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

Can I upgrade to the current version of Ruby (2.2.3) on OS X v10.6.8?

I'm looking at "Install Ruby on Rails · Mac OS X Yosemite", and in the instructions it says to update your OS which I don't really want to do because my computer is getting old.
I also found "How to update Ruby to 1.9.x on Mac?". As far as I can tell, I don't have RVM and I'm afraid of yet another install, in case my system requirements still aren't good enough.
Ultimately, I'm trying to update Jekyll, but I need to update my system a little bit first. I need Ruby 1.9.3 or later. Will "How to update Ruby to 1.9.x on Mac?" work? I'm running Ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]'.
EDIT: I did end up getting RVM installed. For those who find this page in the future, I ran into these issues/help pages:
How to resolve "gpg: command not found" error during RVM installation?
OS X Mavericks install rvm WARNING * WARNING: You have '~/.profile' file...
RVM installation missing $PATH * WARNING: Above files containsPATH=with no$PATHinside
I suggest that you use RVM to install Ruby.
curl -sSL https://get.rvm.io | bash -s stable --ruby
You need to restart the terminal in order to run rvm:
rvm install 2.2
rvm use 2.2 --default
This is what worked for me
\curl -sSL https://get.rvm.io | bash -s stable --ruby
For the most up-to-date info on how to do this, check this documentation.
You do not need the latest version of OSX to run an updated version of Ruby. Whether or not you need something more current than 10.6.8 to run 2.2.3 I cannot tell. But 1.9.3 should build just fine and 2.2.3 likely will as well.
Using rvm (or rbenv, or ruby-build, or whatever) is certainly an option if you are simply doing development. Then you can have multiple ruby versions at your command without having to disturb the system ruby. Be aware these are not a panacea. Each has its own complexities and egocentricities. Go to the project websites and read the documentation carefully or you can easily get betrayed by your assumptions about how things 'should' work.
All of ruby version managers should install on any version of OSX that supports the build tools required by the Ruby that you want to host. However, be aware you will need installed the OSX xcode application for your system (available free from the Apple App Store but you need an account) and you will need the optional command line tools for xcode as well (also from the App Store).
If you want to update the system ruby then take a look at either the homebrew or macports projects. These provide up to date versions of many, many linux projects for OSX, including Ruby (and git). You will need to meet the same xcode requirements. A build is a build wherever the binaries end up.
The system from which I am writing this answer once ran Snow Leopard and I had at least Ruby 1.9 dot something installed on it via Ports. I am currently paused at 10.9.5 and am running:
ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin13]
Without any problems.
In case anyone bumps into the same error I did: “Requirements installation failed with status: 1.”, you need to install homebrew.
Use this:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Ruby, rubygems and rails conflict with stock Mac OS X Leopard files

Ok guys, so I've been trying to install ruby on my mac for the past two days. What seems to be happening is that there's a conflict between the stock ruby, rubygems and rails from Mac OS X Snow Leopard and the ones I'm trying to install.
I'm using rvm to get the files, therefore I'm running rvm install 1.9.2. Installation seems to go normally, but when I run ruby -v, it shows me the old version (1.8.7). Same goes for rubygems. While rvm should installs it, when I run gem -v, old version is shown (1.3.5). \
This screenshot shows what I'm saying: http://cl.ly/2a3m1v0u331i272z2J22
Thank you.
Once you've installed RVM, you also need to tell you system that you want to use that version of Ruby. This is usually done via:
rvm use 1.9.2
However, when you open a new shell, it will revert back to the system default. If you want to set 1.9.2 as your default ruby, use:
rvm --default use 1.9.2
I suggest you look through the documentation a bit more to help you get the most out of RVM:
Basics: https://rvm.beginrescueend.com/rvm/basics/
Best Practices: https://rvm.beginrescueend.com/rvm/best-practices/
Check your PATH variable.
echo $PATH
/usr/local/bin should be before /usr/bin.
If not so - change it in your /Users/Your_name/.bash_profile

How to update system Ruby to 1.9.2 on Mac?

I saw an answer saying I should use RVM. But I don't know how even after:
$ rvm system
$ rvm current
system
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
The title of the question, "How to update system Ruby to 1.9.2 on Mac" makes me wonder if you are trying to upgrade Apple's installation of Ruby 1.8.7 to 1.9.2. If that is true, STOP and do NOT try that. The Ruby installed by Apple is for their use, and apps installed by Apple use it.
find /usr -name '*.rb'
will list the reasons why.
RVM and other apps allow you to install Ruby safely, so unless you have very good knowledge of how Unix and the Mac work I strongly recommend you stick to them.
A very common problem we see is that the installation wasn't completed. Read the "Installation" section in the RVM installation page to double-check you've completed everything.
To install Ruby 1.9.2 do:
rvm notes
and read and install the needed dependencies. Then do:
rvm install 1.9.2
rvm use 1.9.2 --default
will tell RVM to always use 1.9.2 as a default. You can switch to the system version installed by Apple using:
rvm use system
and switch back using
rvm default
If you don't want an RVM-based solution:
Download and install Apple's Xcode developer tools so you get GCC et al, the ability to build your own software. (This is 4.25GB, but you only need to download it once.)
Download and extract the Ruby Source Code. (10.6MB)
Open a Terminal window and change into the directory of the source code.
Run the command ./configure && make; get a cup of tea while you wait
Run the command sudo make install to install this Ruby; you'll need to supply your administrator password
Modify your PATH environment variable to put /usr/local/bin in front of /usr/bin (so that your new Ruby is found before the system Ruby). You can do this by creating or editing a .profile file in your home directory to have the line:
export PATH="/usr/local/bin::$PATH"
If you're running TextMate, you'll also want to go to TextMate ▸ Preferences ▸ Advanced ▸ Shell Variables
and add or edit a PATH variable like this:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
After this, rvm use system will use your 1.9.2p180 (the current version as of this post) install.
I'm assuming you're not sure how to install a new version of ruby with RVM - try:
rvm install 1.9.2
To then make it the default version to use:
rvm use 1.9.2 --default
Consider also: "for OS X try using RailsInstaller for OS X or try the official RVM GUI JewelryBox" -- Quoted from from the 4rd or 5th screen the RVM install page found here http://rvm.io/rvm/install
Whatever you do do not touch or mess with the system default Ruby that ships with your Mac I did that to see what would and my system was out of whack. If you would like to use a different version of Ruby use rvm.

Resources