Skip to content

Instantly share code, notes, and snippets.

@hamstar
Created December 12, 2011 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamstar/1467942 to your computer and use it in GitHub Desktop.
Save hamstar/1467942 to your computer and use it in GitHub Desktop.
#!/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.
environment_id="ruby-1.9.3-p0@captor"
#
# Uncomment following line if you want options to be set only for given project.
#
# PROJECT_JRUBY_OPTS=( --1.9 )
#
# 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"
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
then
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
fi
else
# If the environment file has not yet been created, use the RVM CLI to select.
if ! rvm --create use "$environment_id"
then
echo "Failed to create RVM environment '${environment_id}'."
exit 1
fi
fi
#
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
# it be automatically loaded. Uncomment the following and adjust the filename if
# necessary.
#
# filename=".gems"
# if [[ -s "$filename" ]]
# then
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
# fi
# If you use bundler, this might be useful to you:
# if command -v bundle && [[ -s Gemfile ]]
# then
# bundle install
# fi
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'rake', '0.9.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano'
gem 'rvm'
# Add Exec JS
gem 'execjs'
gem 'therubyracer'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', '~> 0.8.3', :require => false
end
➜ hamstar@usavps01 /www/xx/current bundler show
zsh: correct 'bundler' to 'bundle' [nyae]? y
Gems included by the bundle:
* actionmailer (3.1.3)
* actionpack (3.1.3)
* activemodel (3.1.3)
* activerecord (3.1.3)
* activeresource (3.1.3)
* activesupport (3.1.3)
* arel (2.2.1)
* builder (3.0.0)
* bundler (1.0.21)
* capistrano (2.9.0)
* coffee-rails (3.1.1)
* coffee-script (2.2.0)
* coffee-script-source (1.1.3)
* erubis (2.7.0)
* execjs (1.2.12)
* highline (1.6.8)
* hike (1.2.1)
* i18n (0.6.0)
* jquery-rails (1.0.19)
* json (1.6.3)
* libv8 (3.3.10.4)
* mail (2.3.0)
* mime-types (1.17.2)
* multi_json (1.0.4)
* net-scp (1.0.4)
* net-sftp (2.0.5)
* net-ssh (2.2.1)
* net-ssh-gateway (1.1.0)
* pg (0.12.0)
* polyglot (0.3.3)
* rack (1.3.5)
* rack-cache (1.1)
* rack-mount (0.8.3)
* rack-ssl (1.3.2)
* rack-test (0.6.1)
* rails (3.1.3)
* railties (3.1.3)
* rake (0.9.2.2)
* rake-compiler (0.7.9)
* rdoc (3.11)
* rvm (1.9.2)
* sass (3.1.11)
* sass-rails (3.1.5)
* sprockets (2.0.3)
* therubyracer (0.9.9)
* thor (0.14.6)
* tilt (1.3.3)
* treetop (1.4.10)
* tzinfo (0.3.31)
* uglifier (1.1.0)
➜ hamstar@usavps01 /www/xx/current rvm list gemsets
rvm gemsets
ruby-1.8.7-p352@global [ x86_64 ]
ruby-1.9.3-p0 [ x86_64 ]
ruby-1.9.3-p0@global [ x86_64 ]
ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.2-p290@global [ x86_64 ]
ruby-1.9.3-rc1@captor [ x86_64 ]
ruby-1.9.3-rc1 [ x86_64 ]
ruby-1.9.3-rc1@global [ x86_64 ]
ruby-1.9.2-p290@rails31 [ x86_64 ]
ruby-1.9.2-p290@captor [ x86_64 ]
=> ruby-1.9.3-p0@captor [ x86_64 ]
ruby-1.8.7-p352 [ x86_64 ]
➜ hamstar@usavps01 /www/xx/current rvm list
rvm rubies
=> ruby-1.9.3-p0 [ x86_64 ]
ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.3-rc1 [ x86_64 ]
ruby-1.8.7-p352 [ x86_64 ]
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
# RVM is unavailable at this point.
raise "RVM ruby lib is currently unavailable."
end
end
# Pick the lines for your version of Bundler
# If you're not using Bundler at all, remove all of them
# Require Bundler 1.0
ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment