-1

Some while ago, our .rvmrc file looked like this (pretty default):

#!/usr/bin/env bash

# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory

# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
#     echo "rvm use 1.9.3" > .rvmrc

#environment_id="ruby-1.9.3-p0@iq"
environment_id="ruby-1.9.3-p0"

# Uncomment the following lines if you want to verify rvm version per project
# rvmrc_rvm_version="1.14.1 (master)" # 1.10.1 seams as a safe start
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
#   echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
#   return 1
# }

# First we attempt to load the desired environment directly from the environment
# file. This is very fast and efficient compared to running through the entire
# CLI and selector. If you want feedback on which environment was used then
# insert the word 'use' after --create as this triggers verbose mode.
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
  && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
then
  \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
  [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
    \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
else
  # If the environment file has not yet been created, use the RVM CLI to select.
  rvm --create  "$environment_id" || {
    echo "Failed to create RVM environment '${environment_id}'."
    return 1
  }
fi

# If you use bundler, this might be useful to you:
# if [[ -s Gemfile ]] && {
#   ! builtin command -v bundle >/dev/null ||
#   builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
# }
# then
#   printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
#   gem install bundler
# fi
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
# then
#   bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
# fi

To be used with RubyMine, a collegue changed it to the following

rvm ruby-1.9.3-p0 --create

The bad is, that my TextMate now automatically switches to Ruby 1.8.7 when executing a file from within the folder, so it doesn't work with this anymore (but before, it did by setting the TM_RUBY variable to /Users/josh/.rvm/bin/rvm-auto-ruby). As I'm the only TextMate user, I'm on my own now to figure out what's wrong. Anybody has an idea?

When I remove the .rvmrc file, then it loads the default RVM ruby version - if it's there, it loads the system ruby (1.8.7).

I also tried the wrapper approach, described on the rvm page, but this also loads the system ruby (1.8.7).

Thanks for any help! Josh

Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152

1 Answers1

-1

check the docs at RVM Site Texmate integration

mpapis
  • 52,729
  • 14
  • 121
  • 158
  • This is the exact same link that I reference in my blog, and both ways described do not work. – Joshua Muheim Nov 10 '12 at 07:37
  • Yes, I did. Is there an easy way to update the system ruby to 1.9.3? Or is this a bad idea? – Joshua Muheim Nov 11 '12 at 11:33
  • 1
    rvm does not affect your system ruby, you could set default - and this is what rvm will load when you open a new login shell – mpapis Nov 11 '12 at 12:57
  • I know, but this doesn't solve my problem: TextMate simply doesn't load any RVM Ruby version, it loads the System version. I guess it just doesn't like the content of the `.rvmrc` file, which is `rvm ruby-1.9.3-p0 --create`... As I don't really understand, what can and should be in this file, I'm not really able to hunt this problem down any further. I switched to RubyMine now... what an awful workaround! :P – Joshua Muheim Nov 12 '12 at 09:01
  • 1
    did you trusted the `.rvmrc`? like: `rvm rvmrc trust` called in the project dir. – mpapis Nov 12 '12 at 13:30