0

I had some issue when checking for rails version in OSX terminal ie when give rails -v its saying Rails 5 requires Ruby 2.2.2 or newer.

But actually I had ruby ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16] installed. But whenever I take a new terminal window and issues ruby -v its giving me the version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16].

What's actually happening here? Can some one help

Vijay
  • 53
  • 1
  • 1
  • 9
  • This is more of a ruby question, and even more so a Unix/OSX question over a ruby-on-rails question. – Dean Galvin Oct 13 '16 at 17:42
  • Do you have a ruby version manager installed? (e.g. `rvm`) – Dean Galvin Oct 13 '16 at 17:42
  • Yes I do have rvm and even after giving rvm --default use 2.3.1, opening a new terminal is returning the system ruby version ie 2.0.0 – Vijay Oct 13 '16 at 17:51
  • is it because of the $PATH? @DeanGalvin , I am unable to figure it out yet. – Vijay Oct 13 '16 at 17:52
  • Do you have 2.3.1 installed? Is RVM installed correctly? – Dean Galvin Oct 13 '16 at 17:54
  • 1
    Yes @DeanGalvin, I do have and I think I just figured it out, I had certain other entries in bash_profile which is resetting the path every-time I open a new terminal , now I had removed certain paths and now its working fine. Also currently I had rails 5.0.0.1 installed which I had some issues with generator scripts, so is there a way to have the rails 4.2.6 as well ? – Vijay Oct 13 '16 at 17:56
  • You can have as many gems installed as you want. You may want to look into gemsets to silo gem versions to specific apps. – Dean Galvin Oct 13 '16 at 17:58
  • @DeanGalvin and regarding rvm installation, I hope its installed correctly, but whenever I issues rvm gemset list, its showing a warning that says - Path is not properly setup , using rvm version 1.27.0 .. Wish I had an 'rvm doctor' – Vijay Oct 13 '16 at 18:02
  • Make sure you are appending to your PATH and not overwriting it. http://stackoverflow.com/questions/9018598/ruby-on-rails-rvm-path-issue might have some insight into your problem. – Dean Galvin Oct 13 '16 at 18:04
  • Well, the path correctly given and right I had to downgrade from 1.27 to 1.21.12 as per this https://github.com/rvm/rvm/issues/3419 And now its not showing that path problems! Well am not sure what exactly was the issue. – Vijay Oct 13 '16 at 18:36

0 Answers0