Posts Tagged ‘ubuntu’
Walking With Rails 1 – Setup On Ubuntu
Overview
One of my goals for 2010 is to gain a decent understanding of the Ruby On Rails framework. I don’t think that this knowledge will directly help me with my current job (as a FileNet P8 administrator), but I do think that it will provide some good benefits.
First, learning about something that’s a little bit outside of your comfort zone can often help you with your day-to-day tasks. For example, if you teach yourself the basics of Java development, then you will know how to read a stack trace. Having this knowledge is very important if you want to administer software written in Java.
Also, it’s just fun. Creating something useful out of a few lines of text never ceases to amaze me. Also, I find that learning new technical skills is good for your brain.
Finally, who knows what the future may bring? It never hurts to know as much as you can about popular technologies in general when you work in IT.
So to get started, I purchased a copy of Agile Web Development with Rails, Third Edition from the Pragmatic Programmers’ web site. This book seems to be one of the best for beginners, and I really love that you can buy DRM-free ebooks from the Pragmatic Programmers’ web site.
Installing Ubuntu Packages
So enough background information. Here’s how I set up my system to get started with Rails development. First, I installed all of the necessary software on my Ubuntu 9.10 machine that was available as an Ubuntu package:
sudo apt-get install rails ruby-full rubygems rake mongrel git-core sqlite3
Here’s why I installed more than just the rails and ruby pacakges. When you install Ruby from source on a Linux machine, you get a lot of software. In addition to the Ruby runtime, you get fun tools like irb, rubygems, rdoc, ri, and rake. However, when you install the ruby package on Ubuntu and Debian, you just get the Ruby runtime along with a a couple of libraries. Since I’m lazy efficient guy, I decided to install the ruby-full package instead to save a few keystrokes. Unfortunately, the ruby-full package still doesn’t include rake or rubygems, so I installed those manually.
Mongrel is a developer’s web server that is designed to work very well with Ruby on Rails development. Since I am also impatient, I wanted a web server that would work a little faster than WEBrick.
Finally, I installed git because I wanted to share code between two different computers. Git is a version control system that is very popular with Ruby developers, so I figured that I would use the most popular Ruby-related tools while I’m learning about Ruby.
Installing Software Without apt-get
Natrually, you can’t install everything that you need with apt-get. For starters, the version of rails that is used in Agile Web Development with Rails, Third Edition is 2.2.2, so let’s install that using rubygems:
sudo gem install rails --version 2.2.2
This operation took a little while (~ 7 minutes) on my machine for some reason.
Note: For some reason, this bog
Next, I’m a Vim user, so I would like to see if the rails.vim plugin would help me at all. There is an official Ubuntu package for this plugin called vim-rails, but when I try to install it using apt-get, I get the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:
vim-rails: Depends: vim-full but it is not installable
E: Broken packages
When I tried to install the vim-full package on my machine, I got this error:
Package vim-full is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vim-full has no installation candidate
Ok, so after all of that, let’s just install it the easy way:
(Download the latest version of rails.zip from the rails.vim download page)
$ cp rails.zip ~/.vim$ cd ~/.vim$ unzip rails.zip
Finally, open vim or gvim and execute the following command:
:helptags ~/.vim/doc
In case your interested, here are the other Vim-related packages that I have installed on my machine:
- vim-common
- vim-gnome
- vim-gui-commom
- vim-runtime
- vim-tiny
Conclusion
And that’s it! I now appear to have everything that I need to complete the beginning examples in Agile Web Development with Rails using Ubuntu 9.10 and Vim.
Update (1/20/10) – I added the sqlite3 package to the apt-get line above. This package is necessary if you want to query your database manually.
Ubuntu 9.04 => 9.10 Upgrade
I just finished upgrading my MythTv/printing/data/everything server from version 9.04 of Ubuntu to 9.10. For the first time, I tried using the Software Update program to upgrade my entire system, and it went surprisingly well. Here are some of the highlights; hopefully they will help a few other people.
MythTv
The OS upgrade included an upgrade of MythTv from 0.21 to 0.22, so I was a little nervous about how well mythbackend and all of my MythTv-related applications (like mythweb and nuvexport) would work. To my surprise, mythbackend and mythweb both upgraded flawlessly. This is a really impressive feat, and it reflects the hard work that the MythTv package maintainers put into each Ubuntu release.
The nuvexport package is broken for me, but I think that’s because I compiled a customized version of ffmpeg. Oh well, this seems to be a common hurdle when I upgrade Ubuntu.
One little thing that I did have to fix after the upgrade was my MySQL configuration. The upgrade laid down the default version of the /etc/mysql/my.cnf file (after asking, of course). This file was configured to block any computer from using MySQL over the network. This is bad for me, because I like to watch my MythTv movies from other computers using mythfrontend.
To fix this, I simply commented out the following line in my.cnf on my MythTv server by placing a # in front of it:
bind-address = 127.0.0.1
After that, I simply restarted MySQL and I was able to use mythfrontend from my other computers.
Note
If you are on a network with other untrusted hosts, then you will want to use a more secure configuration than this.
VirtualBox
I run Windows XP in a VirtualBox VM for work, so it’s very important that both VirtualBox and my XP image work properly at all times. Again, to my surprise, everything worked perfectly after the upgrade. I didn’t even need to re-install VirtualBox. The VirtualBox kernel module was automatically re-compiled during the upgrade process, so I didn’t even have to do that.
Please note that I was using the absolute latest stable version of VirtualBox (3.0.12) before I started the upgrade. Your mileage may vary if you are using an older version.
Overall
Again, I am very impressed by how well everything went. I don’t see why I would ever choose to do a fresh installation of Ubuntu again on this machine.
Caveat Emptor
The automatic upgrade process is far from perfect, and your results may be different. Before you start any major upgrade, make sure that you perform the following steps:
- Make a backup of all of your important files – I use rsnapshot to back up my important files daily, and it has saved my bacon more than a couple of times. Also, it’s a good idea to store this backup on a separate disk from the boot disk.
- Download the current and target versions of Ubuntu and burn them to CD’s – If things do go south, then you will want to be able to either reinstall the current working version of Ubuntu or the target version. Having the actual ISO’s available on a CD may save you a ton of time and grief.
Good luck!
Using My Creative Zen With Ubuntu 9.04
I’ve been using an 8 GB Creative Zen player now for about a year, and in general, I’m very happy. It was about 25% cheaper than a comparable iPod, it can do more stuff, and it has ended up being very durable and easy-to-use.
Another thing that I initially liked about the Zen was how well it worked with Ubuntu Linux 8.04. From Amarok, I could add and manage files as easily as I could with my old iPod.
Then I updated my OS to use Ubuntu 9.04. The Zen would mount automatically when you plugged it in, but I couldn’t access it using any music player such as Amarok, RhythmBox, or Banshee. And if I could access the player using one of those apps, the connection was always very flaky. I might be able to move one or two songs, but eventually, something would crash and I would have to start over again.
This thread on the Ubuntu forums shows that many other Zen users were having the same problem:
The basic advice was to unmount the Zen after it was automatically mounted, and then access it using your favorite music player. This only worked for me sporadically at first. And if that wasn’t weird enough, the Amarok maintainers decided to do the following:
- Completely change the Amarok GUI interface
- Completely change the way you copy music to an MP3 player.
I figured almost everything out eventually, so I thought I would share it here.
- First, plug your Zen into your computer. You should now see a Zen icon on your desktop.
- Next, right-click on that icon and choose the Unmount Volume option. This may seem counter-intuitive, but it’s what you need to do.
- Next, open Amarok. If you don’t see the Amarok window after a minute, then look for the howling wolf icon in your task tray. You will need to right-click on it and choose Restore.
- Note: This process may work with other music players, but I haven’t tested it.
- After Amarok opens, you should see the following items in Amarok:
- An MP3 player icon with a red X and green + next to it.
- Your Zen listed on the left-hand side of the screen.
- If you don’t see it at first, then make sure that you have clicked on the Collection button on the left-hand side of the screen.
- Also, If you see the MP3 player icon but your player isn’t listed on the left-hand side of the screen, then click on the green + button.
Now you can copy individual songs from your Local Collection by right-clicking on a song or album and choosing Copy To Collection -> Creative Zen. That should do it. I’ve had pretty good luck with this system as long as I didn’t try to move over 6 albums’ worth of MP3’s at once.
And here are some of the differences that you need to get used to when using the 2.x version of Amarok:
- You can no longer copy playlists over to your Zen. This is a big disappointment to me, and I can’t figure out why the Amarok maintainers took this functionality away.
- You can no longer “queue” up MP3’s that you want to copy to your Zen and then copy them all over at once. Again, another great feature that was taken away for some mysterious reason.
- Album covers are no longer copied to your Zen. This isn’t a huge disappointment, but it was always a nice feature of the pre-2.x version of Amarok.
In the end, I’m very appreciative that Canonical, the Gnome group, and the Amarok maintainers provide such excellent software that makes my life so much more enjoyable. And I’m glad that I finally figured out a somewhat-reliable process for copying MP3’s from my hard drive to my Zen.
Notes On Installing Ubuntu 9.04 And Easy Peasy 1.5
It’s unlike me to upgrade my systems very often since it can take so much time, but I was moved recently to upgrade both my “server” (to Ubuntu 9.04) and my EEE PC 900 (to Easy Peasy 1.5). In general, I’m very impressed with how much better Linux-on-the-desktop gets every 6 months, and I look forward to at least another 8 years as a happy desktop Linux user.
One of the great things about Ubuntu is that it really is just painless to set up some pretty sophisticated servers. For example, I use my Ubuntu server to record television shows using MythTv, which can be very difficult to install. However, using the Ubuntu packages, I was able to get my system up-and-running in less than 10 minutes.
I do have one very small criticism of Ubuntu, and it’s that they keep making it harder and harder to install ffmpeg from source. The “stock” version of ffmpeg that comes with Ubuntu can’t do a lot of cool things like convert videos to the H264 format, so one of the first things that I usually do after installing Ubuntu is compile a more robust version of that application. Well, the process I used to compile it in 8.04 definitely did not work with 9.04 for some strange reason. Thank goodness that I found this tutorial, which made things very simple.
One really great thing about the 1.5 version of Easy Peasy is that I can now use some Compiz effects with my EEE PC 900. Previous versions of Easy Peasy didn’t even allow me to turn Compiz on. Hooray for tons tap-dancing sprites on my screen!
Here are some of the resources that I used to set up my Ubuntu 9.04 and Easy Peasy 1.5 systems. Maybe someone else will find them to be useful:



