Wrong ruby version detected on mac after brew installing - ruby

When I run
ruby -v
i get ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
this is after installing the latest version of ruby with brew install ruby
tried uninstalling and reinstalling and same thing. How can I get the latest version of ruby? If relevent, I need it for gem install bundler which requires a later version.

This is how to update your ruby version steps
To check what your ruby in now
$Ruby -v
Update it to ruby version 2.3.7
$rvm list known
$rvm install 2.3.7
$rvm use 2.3.7 --default
$gem install bundler
Let me know if does that help!

Related

Managing rubies with rvm but rbenv replying with ruby version not installed

I used to use rbenv to manage ruby versions. I uninstalled it because I had to switch to rvm to install an old version of ruby. Now in my project, if I do ruby -v I get ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] but when I try to create my database with bundle exec rails db:create I get rbenv: version '2.3.1' is not installed. Can someone help me with that ?

Ruby RVM gives me version 2.0 but Bundler says I'm incorrectly running version 2.3

I am just starting to work on an old Ruby Rails project. The Gemfile specifies:
ruby '2.0.0'
I am running a new version of Ubuntu, which I think came with Ruby 2.3 as the default. So I install RVM and then I:
rvm --default use 2.0.0
ruby -v
which gives me:
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
then I run:
bundle install
and I get this error:
Your Ruby version is 2.3.1, but your Gemfile specified 2.0.0
How do I get RVM to enforce the correct version of Ruby?

Old Ruby version is overriding new Ruby Install

I'm trying to update Ruby from 2.0 to 2.4. The installation went through, but when I type in terminal ruby -v I'm shown the following:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
I have no clue on how override the old version. Any assistance would be awesome.
To make ruby 2.4.0 as your default ruby version :
rvm --default use 2.4.0
Now , ruby -v will show ruby-2.4.0
If not installed already then Run:
rvm install ruby-2.4.0
Reference : rvm documentation
In case of chruby, Run
chruby ruby-2.4.0
to make ruby-2.4.0 as default version

Cannot install 'github-pages'

I tried installing github-pages using gem:
sudo gem install 'github-pages'
However, I get the following error:
ERROR: Error installing github-pages:
public_suffix requires Ruby version >= 2.0.
But when I checked my ruby version using ruby --version, it shows:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
So, my understanding is that gem is somehow referencing an older version of Ruby(previous was 1.9.3). How can I fix this problem? My OS is Ubuntu 14.04 and I upgraded ruby using ruby-install.
I believe you do not need to install github-pages globally, as you are trying.
Just removing sudo in front of your command will do the trick:
gem install 'github-pages'

I can't install the first version of any Ruby with RVM

When I try to install the 1.8.7 version of Ruby:
rvm install 1.8.7
He actually install Ruby 1.8.7-head (1.8.7 patchlevel 376).
How can I install the real first version (http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz)?
Try this:
rvm install 1.8.7 -l 0
or
rvm install 1.8.7-p0
RVM is installing the latest patchlevel by default, so you need to specify the patchlevel that you want.

Resources