Rvm Doesn't Switch Rubies

RVM doesn't switch Rubies

Typically rvm support is easiest via IRC (#rvm on freenode) - in this particular case, what does running "type rvm | head -n1" show? it should show "rvm is a function". If not, that means the line to source rvm isn't being run correctly and hence switching doesn't work. Typically this means you either have a return in your ~/.bashrc or you missed adding the line to source rvm.

Changing rvm_ruby_version doesn't change the ruby version

1.9.1 is a ruby compatibility version, this means that all 1.9.x rubies are supposed to be binary compatible

Can't change RVM default

You have multi-user installation, but I provide also information/instructions for user installation.

For multi-user installations:

Multi-user installations use /etc/profile.d/rvm.sh - this file is sourced every time any shell is spawned, this includes when you login, anything you do is already working in context of the loaded earlier default.

You need to restart computer for this to make effect.

For user installations:

you need to update your .*rc configuration files for --default to take effect:

rvm get stable --auto

and restart your computer.

Restart required for both

Restart is required because the earlier default was loaded before/while logging in, with the updated config files the loading point moves to proper place and there should be no more problems with changing default.

Default in scripting

When RVM is used as binary from $rvm_path/bin/rvm it can not set --default as it's bound to use and use is not working in scripting mode, you can use following commands to manage default:

rvm alias delete default 
rvm alias create default 1.9.3

And to make it effective (replacement for rvm use default):

source $(rvm default do rvm env --path)

RVM .ruby-gemset file does not switch gemsets

It seems you must have both a valid .ruby-version file and a .ruby-gemset file in order for rvm to make the switch.

I was hoping it would switch gemsets and use the default ruby version, since the gemset is one of the existing gemsets for my default ruby. But that's not how it works.

RVM do not recognize system's ruby version

{~} ∴ rvm list
rvm rubies <<< important

As it tells you , it only lists rvm rubies. Run rvm system to switch to system ruby.

RVM is not a function, selecting rubies with 'rvm use ...' will not work

Your console is not running as a login shell and hence have no access to rvm function. If you are running Ubuntu, you can:

  1. Open console
  2. Select Edit -> Profile Preferences
  3. Select tab: Title and Command
  4. Check box 'Run command as a login shell'
  5. Restart terminal

Ruby Mine complains that Cannot switch SDK. even if the SDK is there and available

I found for a similar problem (Rubymine 6.3.1 and Ruby 2.1.1) that I had to format .ruby-version in the following way:

ruby-2.1.1

Note the prefix 'ruby-" to the version number. I'm not sure whether this is an RVM, Ruby, Rubymine, or some other issue that caused this problem, but the fix I mentioned worked on my Mac.



Related Topics



Leave a reply



Submit