Skip to content

Instantly share code, notes, and snippets.

@alexpc
Created April 17, 2012 13:00
Show Gist options
  • Save alexpc/2405825 to your computer and use it in GitHub Desktop.
Save alexpc/2405825 to your computer and use it in GitHub Desktop.
Small wrapper for Ruby scripts running on RVM Single-User installations
#!/bin/bash
# Change those for valid ones
HOMEDIR=/home/yourlogin
RUBYVER="1.9.2-p318"
# Adding to $PATH paths for rvm and ruby executables
PATH=$PATH:$HOMEDIR/.rvm/bin:$HOMEDIR/.rvm/rubies/ruby-$RUBYVER/bin/
# Creating variable containing path to installed gems
RUBYLIB=$HOMEDIR/.rvm/gems/ruby-$RUBYVER/gems/:$HOMEDIR/.rvm/gems/ruby-$RUBYVER@global/gems/
# Modify locales for your needs, for me it was necessary to use UTF-8 while running with arguments containing non-iso characters
LC_ALL=pl_PL.UTF-8
LANG=pl_PL.UTF-8
# Running script
# Usage: rubywrap.sh ruby rubyscript.rb
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment