Saturday, July 21, 2007

Getting Rails Running on Ubuntu

Time to check out the Rails hype. I borrowed Agile Web Development With Rails, 2nd Edition, from a coworker, and have started working my way through it. So far, so fun. The details:

I'm doing this under Ubuntu, so I figured I'd install via Synaptic. I grabbed just about everything I thought I might need, and started through the book. I got to p. 39, which has a couple of rake commands. These commands failed, and as part of troubleshooting, found https://help.ubuntu.com/community/RubyOnRails. Following its advice, I removed rails and gems from Synaptic, and ran #1, #2 "Install RubyGems via source (recommended)", then #3 and #4. I then tried the commands again, and they worked just fine.

Well, almost fine. When I got around to running gem update --system, I got the following:


Updating RubyGems...
Bulk updating Gem source index for: http://gems.rubyforge.org
Attempting remote update of rubygems-update
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find rubygems-update (> 0) in any repository


On a lark, I ran the same command again, and it ran just fine. Go figure.

I then generated my own rails api docs with the rake doc:rails command, and was able to proceed.

So far, so fun.

Labels:

Friday, July 13, 2007

Feisty + Tomcat5.5 HowTo

I got the following off of the Ubuntu Forums, and include it here so I know where it is, for next time. (Yes, there's always a next time.) In particular, #2 solved my present issue of not being able to restart Tomcat via the /etc/init.d/ script.

Thanks to Emblem Parade for this:

Argh. So, if you tried installing tomcat5.5 from the repositories, you may have noticed that it's broken. You get a configuration error about JAVA_HOME not being set. Actually, there are three problems! Here's what you can do to get it to work:

1) Install

sudo aptitude install sun-java6-jdk tomcat5.5

(Note that you absolutely need the JDK, not just the JRE.)

2) Set Tomcat's default JAVA_HOME

sudo gedit /etc/default/tomcat5.5

Uncomment the JAVA_HOME line and set it to your JDK path. For Java 6 installed from the repositories, it's as so:

JAVA_HOME=/usr/lib/jvm/java-6-sun

3) Fix catalina.out

Unfortunately, it seems that Tomcat's log file is set to be a pipe, but Tomcat can't seem to start with it. We'll recreate it as a regular file with the same security settings:


cd /var/log/tomcat5.5/
sudo rm catalina.out
sudo touch catalina.out
sudo chown tomcat55:nogroup catalina.out
sudo chmod uo-wrx catalina.out


Tomcat should work now as a daemon. Start it like this:

sudo /etc/init.d/tomcat5.5 start

And point your browser at http://localhost:8180/

Hooray!

Labels:

Wednesday, July 11, 2007

Been Running Ubuntu

Since Novell drank the Microsoft Kool-Aid, we've been replacing our SuSE servers and desktops here at work with Ubuntu. Overall, it's been a very pleasant experience. I got Ubuntu 6.10 Edgy running on my work laptop and desktop, and on my home desktop as well. I then upgraded all three to 7.04 Feisty with no problems on any box except my 64-bit desktop, and that seemed to only be a problem with some X fonts.

I then had the hard drive crash on my home desktop, so I reinstalled 6.10 and immediately upgraded it to 7.04. (I was too lazy to download the 7.04 install CD.)

The only minor annoyance I had with upgrading to 7.04 the first time was that I clicked Go and went to sleep, only to find the next morning that it had stopped awaiting confirmation to something about 10 minutes in. The 2nd 6.10->7.04 upgrade didn't do that, so I'm guessing it was from something that I had installed. But if you're upgrading, you might want to babysit it, and not assume it can run unattended. (YMMV.)

Comparing Ubuntu with all other distros I've used (Gentoo, SuSE, Red Hat, and Slackware way back when), this is very sweet. I had been limping along with wireless on my laptop under SuSE. Under 6.10, I followed some info from the forums, and it just worked. (Admittedly, 7.04 has seen a minor step backwards in wireless, but it still works, and I just haven't taken the time to ask/troubleshoot it yet.)

Synaptic is much nicer than Yast. Not sure how to explain it, but it's just a much more comfortable experience. Gnome is also very nice. I was expecting to try to figure out how to get back to fluxbox, but after a few hotkey tweaks, I'm enjoying Gnome pretty well, and prefer it over KDE, which I used briefly when I installed SuSE.

Bottom line on Ubuntu: I wouldn't go back. Much nicer experience than I was having with SuSE.

Labels: