Ruby on Rails versions

I really like doing Rails work, but if there is one pet peeve that I have, it’s moving between Ruby on Rails versions. There are a fair number of Ruby apps out in the wild, and when handed a Rails app to start maintaining, you need to move from version to version. Of course, what’s interersting is how to check for the different rails versions. For example, some people think doing this will work:

rails -v

That does work, IF you are not using the vendor/rails version of rails. However, this means that you have to know what rails version you’re developing for. This becomes a major pain for certain tags that are simply ignored in Rails 1.1 and are rendered in Rails 1.2. Days can be done developing in Rails 1.2 before deploying on another site, and if you don’t know that you’re running Rails off of vendor/rails, this could be a major problem.

So, how do you determine which rails you’re running?

One way to do it is to go into the console, and run this:


This will load what the application environment sees as its version of rails, which is much more useful than the previous command. However, if you run this command:


You’ll see the Ruby version of phpinfo(), which will give you all the information that you need to rock and roll. There are cases where you may want to downgrade to a prior version, namely if you’re using a plugin that requires a certain syntax in a previous version. However, there’s arguments for and against this behaviour. I would always use the latest version of rails, mainly because it’s easier to give to someone else who’s not as experienced with Rails, and it’s better to have them learn how to use the latest version as opposed to trying to find documentation for previous versions of rails.

So far, I have to say that going between versions of rails is one of the most frustrating things that I’ve found so far with Ruby on Rails.

This isn't directly work related, but this is the coolest thing I ever made!!!!

I just finished hacking a bunch of Infrared LED lights, and here is a picture of the results:

My FTIR Table

So, this is a picture of my hand. This picture was taken by an off the shelf webcam that I modified to only pick up IR light. My hand is touching a piece of acrylic which has LEDs lighting the edges of it. When my hand touches the Acrylic, this causes the tips of my hand and the heel of my palm to form white blobs which can then be tracked by software. This is called FTIR. I now have a multi-touch interface, similar to the Microsoft Surface sitting at my home. The best part about it is that it’s cost me less than $400 to make. This touch screen is very similar to what Jeff Han is doing at his company, Perceptive Pixel.

This is mentioned on this blog because I think this changes everything. This is evident because of the upcoming release of the iPhone, which is also multi-touch. I think with devices like the table that I built (using instructions from, Microsoft Surface and the iPhone, onclick may become antiquated. Of course someone already made something for Flash, so I guess that means that Adobe is already prepared for this, but what about the rest of us??

It’s definitely food for thought. I’ll be posting updates about the table to this blog, so stay tuned!

What's Joe doing now (Answer: Ruby on Rails Dev on his Ubuntu Box)??

As you may have noticed, Ryan’s here and he’s answering the bulk of the support questions. This is because I’m doing more special client project work these days instead of replying to posts. I still read the support box, and I still try to answer as many as I can, but I’m definitely answering far less than I used to.

Although, now I’m a relatively new convert to Ruby on Rails. Not only that, but I now get to do work on my Ubuntu systems, so I get to blog about Ubuntu and Rails! Yay!

Doing Ruby on Rails Dev on Ubuntu seems far easier in many respects to doing it on Windows. (I haven’t played around with TextMate on Mac because I don’t have one) but many of the tools are familiar. They just have some gotchas. I decided that since I haven’t blogged in a while, I’ll blog about this before scrum starts:

The main IDE that I use for everything is Eclipse. I install on it Subclipse, RadRails and Aptana. The thing is that on Fiesty Fawn, RadRails won’t work out of the box. What you need to do in this case is install the Sun Java JVM, and set the /etc/eclipse/java_home on your desktop to point to /usr/lib/jvm/java-1.5.0-sun. java-gjc just doesn’t cut it for RadRails.

Once that’s done, you should be ready to rock for Eclipse. However, there’s a couple more gotchas. You should make sure that you install ALL your Ruby and Rails packages for Ubuntu, otherwise you’ll get some weird stuff. Googling a bit will help you, but you should at least have the irb installed, libopenssl-ruby, libreadline-ruby, libredcloth, librmagick-ruby, libruby, rake, rdoc, and of course ruby installed. I use the gem version of Rails, because I want the latest and greatest rails, and I compile gem and install gem from source.

All in all, things should be good for getting rails going. I’ll have more Ubuntu, Ruby and Rails gotchas in here soon.

PS: If you have problems installing CUI under Linux, please let me know what distro you are running, and I’ll try to help you out and get you hooked up!