6

When I open terminal then enter to the rails application, the rvm will load the gemset in .ruby-gemset file as the following:

> cd my_application/ 
> rvm gemset list

The output as the following:

gemsets for ruby-2.2.2 (found in /home/yakout/.rvm/gems/ruby-2.2.2)
   (default)
=> my_gemset
   global

Then I open new tab in terminal, and run rvm gemset list, the output will be:

gemsets for ruby-2.2.1 (found in /home/yakout/.rvm/gems/ruby-2.2.1)
=> (default)
   global

I put the following line in .profile file:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

And I put the following lines in .bash_profile file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

And I put the following line in .bashrc file:

PATH=$PATH:$HOME/.rvm/bin

And I changed the preferences of my terminal by: Edit -> Preferences -> Title and Command tab -> Run command as a login shell.

How can I make rvm load the current gemset when I open new tab in terminal ?

Mohamed Yakout
  • 2,868
  • 1
  • 25
  • 45

3 Answers3

5

There is a workaround to get the right gemset when you open a new tab. Add this line at the end of your ~/.profile

cd .

I got this from https://github.com/rvm/rvm/issues/2527

patdec
  • 63
  • 1
  • 7
0

You can do this by simply adding two files in your application directory. with the following name :

.ruby-gemset

.ruby-version

Inside .ruby-gemset just mention your gemset name

Inside .ruby-version just mention your ruby version

0

So you want it to be your default even when you're not in an application? I would use:

 rvm --default use 2.2.2@my_gemset
Mike K.
  • 3,751
  • 28
  • 41