Open Source

RVM (Ruby Version Manager) and Ruby On Rails

Here is a brief overview of Ruby Version Manager and some explanation as to why you would want to use it. I began to use RVM when I started my first Rails 3 project. It was a bit confusing at first, but now I couldn't live without it. I have created numerous gemsets for various configurations to include different versions of Ruby (1.87 and 1.91), versions of Rails (2.3, 3.09, 3.1) and different projects that have vastly different gems such as different testing frameworks, different JavaScript libraries, and different ORMs.

This allows me to essentially sandbox each of these applications' dependencies.

One helpful hint I might offer is to get in the habit of declaring your gemset when you launch a new terminal. I tend to have multiple terminals open at once and it took me awhile to remember that each time I launched a terminal, RVM would fall back to my default gemset. So if I clone a Rails 3.1 project, I need to remember to switch to my rails3.1 gemset prior to runninig bundle install.

Simply put, RVM helps:

  1. manage versions of Ruby
  2. manage packages of Gemsets

RUBY

 

$ rvm list
$ rvm install 1.9.2-head

And, you can set a version as default


$ rvm use 1.9.2-head --default

GEMSETS

# Start by creating our gemset(s):

$ 
rvm gemset create rails309

# Or create multiple at a time:

$ 
rvm gemset create rails307 rails31

# The result can be verified by listing the available gemsets:

$
 rvm gemset list

# See everything with list_all, this has been very useful:

$ rvm gemset list_all

# If a gem’s name still leaves room for confusion, simply delete it and create a more meaningful one (e.g., rails31rc):

$ 
rvm gemset delete rails31

Now that we have multiple gemsets installed, we must first select the one we want to use, and we can also set it as the default gemset by passing it the —default flag:


$ rvm use 1.9.2-head@rails309 --default

Installing Rails

Installing rails is as easy as installing any other gem: we only need to specify it’s name, but we can always choose a specific version, or to speed up the installation process by skipping the documentation:

$ gem install rails --no-rdoc --no-ri
# Or
$ gem install rails [-v 3.0.7] [--no-rdoc --no-ri]
# Or
$ gem install rails -v ">=3.1.0rc"

In Summary and Why Am I doing this?

Rails is distributed as a gem, and there are conflicts between Rails 2 and Rails 3, so if you want to run multiple versions of Rails on the same system you need to create a separate gemset for each:

$ rvm --create 1.8.7-p302@rails2app
$ rvm --create use 1.9.2@rails3app

In other words, for application specific gemsets it is convenient to select the version of Ruby and the collection of gems by doing the following:

$ rvm --create use 1.9.2@mongoid-app

# Also, which gemset am I using?
$ rvm gemset name

$ rvm gemdir

Git Cheatsheet

I made the switch from Subversion to Git awhile back, and early on I created a cheatsheet pulled from various sources on the web. I thought I'd share.

Git First-Time System Setup

After installing Git, you should perform a set of one-time setup steps. These are system setups, meaning you only have to do them once per computer:

$ sudo apt-get install git-core
$ git config --global user.email youremail[at symbol]example.com
$ git config --global user.name "John Doe"
$ git config --global user.name "Your Name"
$ git config --global alias.co checkout

As a final setup step, you can optionally set the editor Git will use for commit messages.

$ git config --global core.editor "mate -w"

# Replace “mate -w” with “gvim -f” for gVim or “mvim -f” for MacVim.

Quick Reference – Most Often Used Commands

$ cd /path/to/repository
$ git init
$ git add .
$ git add -u
$ git log
$ git status
$ git commit -m "initial commit"

# made a mistake on the git commit
$ git commit -amend -m "initial commit"

# Add the remote repository

# ex 1
$ git remote add unfuddle git@subdomain.unfuddle.com:subdomain/abbreviation.git

# ex 2
$ git remote add origin git@subdomain.unfuddle.com:subdomain/abbreviation.git

# Configure the repository
$ git config remote.unfuddle.push refs/heads/master:refs/heads/master

# Push master branch to remote repository named unfuddle
$ git push unfuddle master

# Other commands:

# Clone an existing remote repo 
$ git clone git@subdomain.unfuddle.com:subdomain/abbreviation.git

# List all branches within your repo
$ git branch -a

#Create and switch to a new branch "whatever"
$ git checkout -b whatever 

Those are the basics, should be enough to make you dangerous.

EduPunk

Rails 2.0 on Windows: Making Sense of Old Tutorials

I know it is fairly well documented around the web that some of the old 'ROR up and running' tutorials are a bit difficult to digest with the new features in in Rails 2.0. So, I wanted to document my findings. And provide links to the resources that have helped me.

Here's a couple of resources to get started:

akitaonrails.com
weblog.infoworld.com

Stay posted for more of my findings.

American Modern Vintage: Peacefield.info gets Redesigned

So I am calling it Generic American with a splash of Modern Vintage...I guess. I'm having one of those moments as a designer when the 'correct' images are present in my mind's eye, but for various reasons they haven't formulated on the canvas. Yet...but what the heck - I'm in no real hurry. I want to savor the taste of this one.

I absolutely love working on peacefield.info. It is a designer's dream, absolute creative freedom. An opportunity to shine, explore, create and innovate.

So what do I have to work with? Not much yet, and that is ok in some respects, because I don't want to ever steer away from my built in 'open source' aesthetic: championing the best of free fonts and hacked, and neo-Dadaist imagery. This new concoction hopes to blend cinematic urban cityscapes, with an adaptation of the ever trendy rustic earth tone color palette.(see my post on the the Neo-Green Aesthetic)

Actually, keyboardist R. Bruce Phillips says it best:

Peacefield isn't so "Pleasantville." It's grittier, even darker maybe -- or at least it has that side. Kind of like in the face of the ubiquitous B&W photo of the old man who lives on the street. He is generic, he is vintage. His face tells who knows what variety of stories? Some lovely, and some horrific, to be sure.

But there is peace still. His old weather face still attracts us.

Some may not see readily the quality of peace about this town. They might think it a contradiction, or irony, that the gritty, mysterious town has such a "nice" name as "Peacefield." Of course, America is full of contradiction and ironies, and people who don't get it when others do.

Technorati Profile

Syndicate content