infundibulum

Installing Rails (with readline and console support) on Ubuntu LTS

January 27th, 2007

Here’s what I had to do to get Ruby on Rails to run on Ubuntu LTS with a functioning console (and irb).

(By the way, Wordpress has kind of borked up the formatting of this post, there’s a plain version at:

http://ruphus.com/code/rails/railsonubuntu-howto.html

It comes down to:

  1. Random stuff
  2. Ruby (from source)
  3. Mysql packages
  4. Rubygems (from source)
  5. Rails (from a gem)

Building on posts by:

Thanks guys.

Preliminaries

Mostly via Ed Howland’s post (I believe termcap-compat, which he lists, is no longer necessary, since libc is up to 6 or uh erm… well I don’t rightly know, but that package wasn’t in the repos and everything seems to work for me without it! ☻).

sudo apt-get install gcc 
sudo apt-get install build-essential 
sudo apt-get install bison byacc gperf 
sudo apt-get install zlib1g-dev 
sudo apt-get install libreadline5 libreadline5-dev 
sudo apt-get install libncurses5 libncurses5-dev  
sudo apt-get install libssl-dev 

Build Ruby

Download the Ruby source:

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.
tar.gz tar xzf ruby-1.8.5-p12.tar.gz 

And build it. Make some coffee, this takes a while. ☻

cd ruby-1.8.5-p12 ./configure make sudo make install 

Not sure why this is necessary (ActionMailer?)

apt-get install postfix 

You’ll also want Ruby’s documentation stuff:

sudo apt-get install  rdoc ri irb 

Mysql packages

apt-get install mysql-server mysql-common mysql-client libmysqlclient15-dev libmysqlclient15off 
apt-get install libmysql-ruby1.8 

Build Ruby Gems

We’ll be using this to install Rails:

wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz 
tar xzf rubygems-0.9.0.tgz cd rubygems-0.9.0 
sudo ruby setup.rb 

Build Rails

Actually the easiest part, I’ve never had trouble with this (knock wood).

sudo gem install rails --include-dependencies 
sudo gem install mysql 

Note that the mysql gem is really the DB connector for Ruby; it’s not Mysql itself. (We already did that.)

Afterword

Now that I’ve explained what worked for me, let me explain the problem I had, in case you’re interested or facing the same problem.

When I originally followed the steops in Richard Crowley’s post, everything seemed to install fine and Rails worked great.

But I found that my console wouldn’t work, just like Paul Ingles:

Loading development environment.
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require':
 no such file to load -- readline (LoadError)     
 from /usr/local/lib/ruby/1.8/irb/completion.rb:10     
 from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'     
 from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'     
 from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'     
 from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'     
 from /usr/local/bin/irb:13 

This means no readline in irb, and no script/console whatsoever, which I gotta have.

So I tried his solution, which consisted of building readline from source, and then building Ruby. I’m not totally positive (though I’m going to find out soon when I rerun this whole process on my laptop), but I think that the steps I’ve described above obviate building readline from source on Ubuntu.

And now this works! \o/

./script/console 

Leave a comment!

I’d really appreciate comments about this process, especially corrections or simplifications.

I’d also just like to get in touch with other folks running Rails on Ubuntu! Believe it or not not everybody using Rails is on OSX. ;-)

GO BEARS

January 26th, 2007

The message is short and simple: “Teach what you like, it’s all fine with us. But if you put ID in your science courses, we will not accept those courses as adequate for admission to our campus.”

“The Pharmacy of the Developing World”

January 19th, 2007

The Swiss company Novartis is taking the Indian government to court over its legislation pertaining to generic drugs. Novartis wants to make it more difficult for Indian companies to produce generic drugs. According to a report at nature.com MSF is collecting signature under a petition calling on Novartis to drop the case. The medical charity points out that ‘India is the pharmacy for the developing world’.

Further information about the background to the MSF campaign can be found here:

http://www.nature.com/news/2007/070115/full/070115-1.html

The petition is available here

http://www.msf.org/petition_india/international.html

Via technoliberation

$100 laptop could sell to public

January 10th, 2007

BBC: $100 laptop could sell to public

Mr Bletsas said that a philanthropic organisation would be formed to organise the orders and delivery of the laptops.

“It’s much more difficult to do this than making the laptop,” he said.

The aim is to connect the buyer of the laptop with the child in the developing world who receives the machine.

“They will get the e-mail address of the kid in the developing world that they have, in effect, sponsored.”

Wow, I’ll buy two, maybe four. That’s so awesome.

This headline was a joke…

January 8th, 2007

right?

Could “lol” ever become a real live word?

January 6th, 2007

Perhaps I’m off my rocker, but sometimes I wonder if the word lol, as in… erm, you know what it means… could ever escape from the intarwebs into meatspace?

I was just digging through a rather amazing series of photos from an ice storm, which contains the following caption:

Here is a closer crop of the above image. Look how the ice grew as it spun around lol There wasn’t any wind now, otherwise I’m guessing this would still spin like the one I saw the day before.

There’s something about this usage that seems “wordy” to me: for one thing, I find it difficult to avoid a comparison to Cantonese’s famous “tag” word, la, for which the always-amusing UrbanDictionary.com provides the definition:

cantonese exclamation which can be added after every single sentence
so cute la/ okay la/ bye la

I find it difficult to articulate why the particular caption above made me think of this, but there’s something about it… maybe it’s emphasized by the fact that there’s no comma?
Or maybe I really am off my rocker.

This weather…

January 5th, 2007

is totally weirding me out.

61 degrees in January, in DC? Predictions for the 70s tomorrow?

I wish I knew where to find some data to determine whether this is as bizarre as it seems…

Language revitalization isn’t really mysterious

January 5th, 2007

The story of a guy who tries to use only Irish as he travels around… well, Ireland:
Cá Bhfuil Na Gaeilg eoirí? * | The Guardian | Guardian Unlimited

Today, a quarter of the population claim they speak it regularly. I have always suspected this figure and to test its accuracy I decided to travel around the country speaking only Irish to see how I would get on.

Things don’t go well. He can’t buy a map, he struggles to buy a map, and he gets a lot of unfriendly, even menacing stare-downs from people all over.

What I had not factored for was the animosity. Part of it, I felt, stemmed from guilt - we feel inadequate that we cannot speak our own language.

I think he’s right about that. I think that generally speaking, people would like to be able to speak any language at all; if we really had Babelfishes, everyone would use them all the time. (Would they forget what language they were speaking at all?)

Of course, this article is meant to be interesting and to raise a rhetorical point. The problem he faces with the people he tries to talk to is that they know  he also speaks English, but he’s refusing to. I can’t help but think that he could have gone about his task more wisely, and dropped the charade. I imagine that some of those people who felt so flustered might well have been more willing to use what Irish they had if he’d gone about it differently.

I dunno, maybe saying that makes me a sell-out or something, but I believe that you can’t learn or promote any language without being pragmatic about it. If you want to revitalize a Native American language, you have to allow for teenagers wanting to talk about their iPods and Metallica (or whatever you whippersnappers are listening to these days) as much as traditional stuff.

And anyway, he finally finds the real, indisputable, 100% certain answer  to how to revitalize a language:

Teach kids.

I was rapidly approaching a point of despair when some children came on the line. I found they spoke clear and fluent Irish in a new and modern urban dialect. They told me how they spoke the language all the time, as did all their friends. They loved it, and they were outraged that I could suggest it was dead. These were the children of the new Gaelscoileanna - the all-Irish schools that are springing up throughout the country in increasing numbers every year.

Yep, that’s how you do it. And it takes about one generation’s-worth of students.

(Kohanga reo teach the same lesson.)

The most annoying thing on the planet

January 4th, 2007

Is when someone starts a post on a message board beginning with the word “Um.”

Sweet jeebus, that makes me want to barf.

It starts off the conversation by saying “you’re an idiot.”

Doesn’t anyone care about being polite any more?

Oddhead.com, for statistics nerds

January 4th, 2007

Oddhead Blog: Prediction Markets, Gambling, Electronic Commerce, Artificial Intelligence: David Pennock: Yahoo! Research

This is a really interesting blog if you have any interest in stuff like prediction markets. (Incidentally, I’m with Oddhead on the evaluation of prediction markets by Daily Kos — they’re missing the point.)