Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RVM and Bundler on Dreamhost
#
# Step One - Installing RVM
#
curl -L https://get.rvm.io | bash -s stable --ruby
# Then, install ruby 1.8.7 -- you need to basically match the same version of Ruby as Dreamhost
rvm install ruby-1.8.7-p334
#
# I also create a gemset, although this is probably optional
#
rvm gemset create sinatra
rvm use 1.8.7@sinatra
# My project has this very simple .rvmrc
rvm 1.8.7@sinatra
# Install bundler next:
gem install bundler
#
# Step Three - Setup Gemfile
#
# In your Gemfile, you will need to match the version of rack being used on Dreamhost, which is currently 1.2.1:
gem "rack", "=1.2.1"
#
# Step Three - Setup config.ru
#
#!/usr/bin/env ruby
require 'rubygems'
ENV['GEM_HOME']="/home/username/.rvm/gems/ruby-1.8.7-p334@sinatra"
ENV['GEM_PATH']="/home/username/.rvm/gems/ruby-1.8.7-p334@sinatra:/home/username/.rvm/gems/ruby-1.8.7-p334@global"
require 'rubygems'
Gem.clear_paths
require 'bundler'
Bundler.require
require 'mufftweet'
run MuffTweet
#
# Recently I had some problems with my apps on Dreamhost, and I switched to using
# a vendored bundle. I ran this command within each of my projects:
#
bundle install --path vendor
# This installs the gems you need in a vendor/ folder within your project.
# Finally, if you need something to run in cron, you can do it like this:
# The ". ~/.bash_profile" bit loads in the RVM functions that you will need to run anything in cron.
*/10 * * * * . ~/.bash_profile; cd /home/username/appname; /home/username/appname/cron.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.