Screencast: Setting up on Linux
NOTE: Rails 2.3.3 only: Note specification of version number in gem install below; for more information, see https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3144-undefined-method-for-string-ror-234
Remember that the URL want to use is this (step 4 below):
<br /> curl -O -L http://github.com/relevance/etc/raw/master/bash/ruby_switcher.sh<br />
A few notes:
- In order to obtain and run the ruby_switcher.sh code, you will need to install git and curl. And, of course, you will need Sqlite3 and Sqlite3’s development headers. In the example below, I’m using apt-get, which is a package manager used in the Debian/Ubuntu world. If you’re on Redhat or another distribution, you would use yum or whatever tool is typical for that distro. You may need to look up the package names that will provide you with git, curl, etc.Additionally, you will want some packages regarding the “curses” package. Annoying, the installation of curses will install Ruby 1.9 system-wide on your Linux system. We need curses, though, so install these packages; if you require Ruby 1.8.6 or 1.8.7, you should be able to keep using those by re-installing them locally with the ruby_switcher.sh script.
<br /> sudo apt-get install git curl sqlite3 libsqlite3-dev libncurses-ruby1.9 libncurses5-dev libncursesw5-dev<br />
- The blog post cited above discusses the other packages (such as build-essential) that you’ll need to compile Ruby from source on Linux. You’ll need to install these with apt-get (or whatever package manager you use) as well.
- Remember that the ruby_switcher.sh code is installed by a regular user, not by root.
- The URL given for ruby_switcher.sh gets a specific older version. To get the latest, use the URL http://github.com/relevance/etc/raw/master/bash/ruby_switcher.sh
- Now use gem to install Rails and the Sqlite3 gem:
<br /> gem install rails -v 2.3.3<br /> sqlite3-ruby<br />
- To verify, see the verification steps in the OS/X screencast.
Running "install_ruby_191" does take a bit of time. It may look like it's sitting idle but just be patient. Eventually, your console will be spammed with output messages and "Cmmmmms..." However, it doesn't quite install the patch required in Assignment 0 (p243) and I think you'll have to do that separately.
Donnie, everyone:
Yes it does take awhile.
Note that you WILL get version 1.9.1p243 if you download the ruby_switcher.sh with this (step 4 in the instructions):
curl -O -L http://github.com/relevance/etc/raw/master/bash/ruby_switcher.sh
Thank you, I'm embarrassed for not reading the entire post. I have a habit of not looking ahead but hopefully this helps some other anxious-clickity hacker. With the correct ruby_switcher script installation was simply a few steps for everything. The demo also runs fine on ubuntu-hardy-heron.
@Donnie Demuth
I am hugely relieved that the demo works with Hardy . . . There have been rather a lot of changes with Curses (the screen updating software). In fact, it didn't work very well under 1.8.6-7.
Getting all the extensions to build can be a problem. It involves making sure all the right packages have been "apt-gotten". Here is a useful test of a successful install:
ruby -ropenssl -rzlib -rreadline -e "puts 'Happy new Ruby'"
reference: http://amerj.info/2009/03/19/howto-install-rails-23-and-ruby-19-on-ubuntu-for-mysql-and-sqlite3/
@Ken Busch
For what it's worth, if you use the package list from the EC2 screencast, you'll get a system perfectly set up for Ubuntu 9.10. I haven't tried it on other versions.
@john
Oh! I was going to do that one later. I was setting up a Linux virtual machine on my Windows box. Turned out to be way, way easier than I expected. A fellow student had suggested to me that I should do my course work on that configuration -- and now I think he was right.
@Ken Busch
We would use a VM for the course, but my worry has been that then I would have to teach Unix as well as Ruby and Rails!
Which virtual system did you use? This is free: http://www.virtualbox.org/
@john
I used the VMWare player but only because I've used VMWare before.
You're right about having to teach Unix too.