Getting started with rails on Ubuntu

Getting rails running on Ubuntu wasn’t as easy as I expected, there were a few bumps. This is what I learned in the process.

1. Ubuntu isn’t really keeping up to date with the ruby versions. If you do apt-get install ruby you will get version 1.8.7. I happend to get 1.8.7 p249 which turns out to be completely incompatible with rails3.

How to solve this: use rvm to manage ruby versions. https://rvm.beginrescueend.com/
Follow the installation instructions.

2. You want to get ruby version 1.9.2. However it doesn’t come with openssl per default which you will need.

How to solve this: use rvm.

$ rvm package install openssl $ rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr  

3.  You want to install rails using gems.

How to solve this: go to rubygems http://docs.rubygems.org/ Download, decompress and run setup.rb.

4. Now, you should be able to install rails. Don’t use sudo! This will mean that you override the rvm version of ruby and use your system version instead.

$ gem install rails

5. Time for sqlite3. But, you’ll probably get an error message unless you first apt-get install libsqlite3-dev. And then gem install sqlite3-ruby.

Ok, now you should hopefully be able to do a simple hello world. For example:

http://guides.rubyonrails.org/getting_started.html

Advertisements

VirtualBox

I have the great pleasure of be able to run Linux at work. Since I’m working with test it is important that all types of operating systems are represented (there’s probably about 1% of our users who actually run Linux but don’t tell anyone!).  However I am forced to do some tasks in Windows so I’ve installed VirtualBox.

At first I wasn’t too impressed. Sure, the installation was smooth but my desk neighbor runs VMware on his Windows machine and it has many more cool features. Copy and paste, drag and drop files, etc. There is a way to make some of that work with VirtualBox as well.

You need to install the Guest Additions. here’s a guide: http://www.dedoimedo.com/computers/virtualbox-guest-addons.html

Of course, the next time you start your image, it will be in a 800×600 resolution… don’t panic. Just resizing the window in which your VirtualBox is running and it will change resolution.

Now you can create a shared folder to share files between you machine and your virtual machine without having to email them back and forth.

Edit 2011-08-24: setting up a new vbox on my new job I ran into the windows xp shared folder bug again. It seems impossible to see the shared folders in the network using Windows Explorer. The answer is to click the plus sign next to the network instead of clicking the label. This will make the tree of folders appear. I found the solution here : http://www.giannistsakiris.com/index.php/2007/09/28/virtualbox-access-shared-folders-from-windows-xp-guest-os/

Howto: do basic things using ProjectWhite/White

Howto:
– launch an application
– navigate into a submenu
– get a hold of a MDIChild-window.


Public Class Test1

Private Const path As String = "C:\Path\myprogram.exe"

Public Sub TestMethod1()
Dim application As Application = application.Launch(path)

//Find the form
Dim main_window = application.GetWindow("name of window", InitializeOption.NoCache)
Assert.IsNotNull(main_window)

//Find the Menubar and its choices
Dim menu As MenuItems.Menu = window.MenuBar.MenuItem("Menu choice")
menu.Click()
Dim openSubMenuChoice = menu.SubMenu("Submenu choice")
openSubMenuChoice.Click()

//Find the MDIChild-window
Dim child_window = main_window.MdiChild(SearchCriteria.ByControlType(ControlType.Window))
Assert.IsNotNull(child_window)

application.Kill()
End Sub
End Class

Google nerd

Today I’m a google nerd. I spent a lot of time adding Google Labs components to Gmail.

First up, the tasks application. It’s simply a quick way to make a to-do list with checkboxes, the ability to move tasks up and down the list, view/hide finished tasks. The surprise was the ability to pop-out the list into a separate window. Easy and clean!

Second, the Google Docs app. It’s a list of your most recently used Google Documents in an easy accessible box on the left hand margin in Gmail. No need to take the extra step of going to the actual Google Docs page.

Last, I enabled Gears with WordPress so I can use it if I happen to be offline.