Rvm and Osx Lion - Rvm 'Forgets' Gemsets on System Restart

RVM and OSX Lion - RVM 'forgets' gemsets on system restart

It appears that your default RVM ruby is not set.

Try running this:

rvm use --default --create 1.9.2@rails3.1

and then rebooting.

If your gemset already exists, you can omit the --create.

rvm use --default 1.9.2@rails3.1

i'm not using rvm correctly - 'forgets' information on new session

You have a system installation of rvm - /usr/local/rvm, it is not recommended for basic use (mainly because of the problems you have and many others).

Start with cleaning ~/.zshrc from forced PATH= as it is described in this pull request https://github.com/robbyrussell/oh-my-zsh/pull/1359

Then update RVM:

rvmsudo /usr/local/rvm/bin/rvm get head --auto-dotfiles

and restart computer.

There is problem with system installation that it is loading early and the default ruby is loaded when computer is started, you need to restart computer for the new default to be effective. This problem does not happen when you use user installation of rvm.

optionally

Remove system installation and install rvm for user:

  1. Remove system rvm:

    rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm
  2. Restart computer to get rid of environment variables (yes this is required).

  3. Confirm that environment is clear from rvm (should be empty output):

    env | grep rvm
  4. Install user rvm:

    \curl -L https://get.rvm.io | bash

Using RVM with different gemsets in TextMate

I've found the RVM wrappers method to be very buggy, and as you've discovered it doesn't work at all with gemsets unless you do a lot of tedious setup.

I've had some success using the following script as TM_RUBY:

#!/bin/bash

base_dir=${TM_PROJECT_DIRECTORY:-$PWD}
cd $base_dir
exec $MY_RUBY_HOME/bin/ruby $*

As long as you're in a TextMate project and you have a .rvmrc file in the project root it will run your code in the Ruby version and gemset specified in the .rvmrc. The cd makes sure RVM discovers the .rvmrc.

Put the code above into ~/bin/textmate_ruby_wrapper and then go to Preferences > Advanced > Shell Variables and set TM_RUBY to that same path.

rvm installation not working: RVM is not a function

You are not using an login shell.

The process of enabling the login flag is described here, also some details on what a login shell is can be found here.

Thus, you need to check the option "Run as login shell" in the Gnome terminal's settings. It is required to open new terminal after this setting the flag.

Sometimes it is required to set the command to /bin/bash --login.


For remote connections it is important to understand the differene between running interactive ssh session and executing single commands.

While running ssh server and then working with the server interactively you are using login shell by default and it's all fine, but for ssh server "command" you are not using login shell and it would be required to run it with ssh server 'bash -lc "command"'.

Any remote invocation can have the same problem as executing single command with ssh.

Mac OS X Mountain Lion Rails is not currently installed on this system.

Use RVM http://rvm.io or rbenv to install newer Rails versions than what come pre-installed with OS X.

Follow examples on the site https://rvm.io/rvm/install/ but basically:

Install RVM: $ \curl -L https://get.rvm.io | bash -s stable

You can then $rvm list known to see what Rubies are available to you (lots). And simply $rvm install 1.9.3 to get the most current version of Ruby (which as of this writing is ruby-1.9.3-p327)

Set that ruby as your default $rvm --default use 1.9.3

Create a default gemset to store your gems $rvm use 1.9.3@mygemset --create --default

Then install Rails $ gem install rails will get you current which today is same as typing gem install rails -v 3.2.9



Related Topics



Leave a reply



Submit