Sunday, November 14, 2010

Ripping CDs on Ubuntu 10.04

Previous: Candy OM for MongoDB and Ruby - FAIL

So, using RhythmBox to rip CDs seems to work (mostly), although it's excruciatingly slow. There's an additional annoyance, too, in that it gets confused after you've processed a few CDs (people have reported the problem after ripping between 2 and 6 CDs) and you have to restart it to get it working again. It turns out, as well, that just closing the application window doesn't really kill the darned thing. You have to go into System Monitor and shoot the background process in its sleep.

I checked the Ubuntu community docs and found a fair amount of information about CD ripping.

Though there's a warning about a bug in LAME that causes problems for Sound Juicer, I gave Sound Juicer a try because there seem to be a lot of positive comments about it online. After installing the gstreamer libs needed for mp3 support, Sound Juicer consistently and silently died the instant I clicked the button to start the rip. Since this behavior does not result in any mp3 files, it doesn't quite meet my needs. I found a posting on a 2008 discussion list in which someone described exactly the same problem. No one had replied with a solution.

Next up was RipperX, which managed to generate a few corrupted files before collapsing to the floor in a useless heap of bits.

RubyRipper sounded promising, so I tried it. Despite notes to the contrary online, I was unable to find any way to tell RubyRipper that I wanted mp3 output instead of ogg output. It did a good job producing ogg files, though. For all I know, it can do mp3 too, in some mysterious way.

Next I tried Asunder, another program listed on the Ubuntu site. This was simple to install, and didn't require any additional dependencies from off-the-beaten-path repositories or other tweaks:
sudo apt-get install asunder
It has a simple UI that offers a short list of popular audio formats, including mp3. It can also go out to CDDB and look up album information. I found it easy to use, much faster than RhythmBox, and it generated playable mp3 files. A winner.

Asunder has characteristics I appreciate in software: (1) It does just one job and does it well; (2) installation and use are intuitive enough that no user manual is needed; (3) it's packaged and distributed in a way that takes the technical burden off the end user.

Next: Installing Android SDK and Eclipse ADT on Ubuntu 10.04

Thursday, November 11, 2010

Candy OM for MongoDB and ruby - FAIL

Previous: Success with rvm and ruby 1.9.2

Installing Candy and incorporating it with my experimental Sinatra project consisted of doing an rvm install:
rvm gem install candy
and updating the Gemfile with
gem "candy", :require => "candy"
Easy and clean.

Unfortunately, I had no luck at all trying to run the basic Person class example given in the readme, or the Zagnut example, or indeed any other variations I attempted, whether standalone or integrated with the sinatra app. After about four hours of trying, I posted some encouragement on the candy discussion forum and expressed the hope that it will become functional soon. I plan to check back in a couple of months to see if it's working yet. I hope the author will continue working on it, because it's a good concept. (To be fair, he does warn that candy is in an alpha-alpha state.)

Candy has, at least, provided the inspiration I needed to work through the difficulties I was having with installing rvm and ruby 1.9.2. Those bits are now installed and working well. For the moment, I think I'll try to keep going without an object mapper and see how tedious that proves to be. That's probably better for the purpose of learning MongoDB well, anyway. MongoDB has a pretty straightforward API, and it may be sufficient just to wrap persistence logic in a helper class. That way, if I decide to move to an object mapper it should be possible to replace the persistence logic without affecting the rest of the code.

Next: Ripping CDs on Ubuntu 10.04

Success with rvm and ruby 1.9.2

Previous: Ruby 1.9.2, rvm, and Sinatra follies

So, I've spent a couple of evenings playing with Sinatra and MongoDB under ruby 1.8.7. I've learned a bit and made progress in getting Sinatra apps to run on localhost. When I reached the point that I needed an object mapper, I read the descriptions of the ones listed on the MongoDB site. MongoMapper looks really good; very well thought-out, very competently designed, very clean code. But another one, Candy, stood out for me because instead of mimicking the approach of ActiveRecord, it explicitly and unapologetically takes advantage of the unique, very non-relational characteristics of MongoDB.

Candy is relatively new code, and it requires ruby 1.9 as a baseline. That meant I had reached an appropriate point to re-try rvm and ruby 1.9.2.

Having installed rvm three times previously, making plenty of educational mistakes each time, I found the installation procedure easy and quick this time around. I left the system install of 1.8.7 in place, used rvm to install 1.9.2, and set 1.9.2 as the rvm default.

Next step was to ensure existing ruby apps would work under 1.9.2. I started my local Instiki instance and got this message:
Bundler couldn't find some gems.Did you run 'bundle install'?
I tried running 'bundle install' and got
'report-activate-error': Could not find RubyGem bundler
So, I tried 'rvm gem install bundler' and it worked. The 'bundle install' command then worked, too.

At that point Instiki started up normally. So far, so good! (I use Instiki for general notes and record-keeping, so it's in the nature of a "production" system for me. Getting it up and running is always the first order of business when I upgrade ruby.)

I changed to the directory where I've been playing with Sinatra and tried to start my test app. I have a Gemfile there, and when I ran 'bundle install' it appeared to download and install all the necessary gems under rvm.

When running cukes, specs, and the app itself I got a number of errors pertaining to files not found on 'require'. All these errors were due to require 'foo' instead of require './foo'. I expected this, since ruby 1.9.2 does not include the current directory in the ruby load path by default. Once I fixed that on a single line in a single file, everything that had been working before was working again under ruby 1.9.2. Nice!

I have some old side projects in rails that probably will not start. I'll get around to fixing them later. For now, I'm pleased to be up and running at last with rvm and ruby 1.9.2.

Next: Candy OM for MongoDB and ruby - FAIL

Wednesday, November 10, 2010

Ruby 1.9.2, rvm, and Sinatra follies

Previous: Ubuntu 10.04 upgrade: Summary

I recently reported success with installing Ruby Version Manager (rvm). It appeared to install and function correctly; or at least it didn't report any errors. I was able to get my local Instiki up and running with no difficulty.

I didn't do much with ruby since then, up until three days ago. I spent the next two evenings struggling to get things to work. Online resources are plentiful but unhelpful. It seems no one else has experienced the same issues as I have. That in itself suggests pibcak. I readily admit to noob status, but unfortuantely that's not enough information to get things working again.

In hindsight I would say I asked for trouble by trying to use three unfamiliar technologies at the same time: Ruby 1.9.2, rvm, and Sinatra. I saw several bewildering behaviors whose root causes I was unable to pin down:
  • require was sometimes able to locate gems and sometimes not; GEM_PATH was correct; I realized the current directory was no longer included in the ruby load path by default, and changed code accordingly; no luck.
  • It seemed as if public methods inherited by a subclass were treated as private methods at runtime.
  • In theory, you can write a Sinatra app file as a plain script and it will inherit from Sinatra::Application silently; alternatively, you can write the file as a ruby class that extends Sinatra::Base, and it will work the same. I found that with the former method, Sinatra recognized its routes and functioned as expected; when the main Sinatra app file was a ruby class, no routes were ever recognized. By the same token, cucumber and rspec only worked against a class file, and not against the plain script version of the same Sinatra file. So, I had a choice between being able to run cukes and specs, or being able to run the app.
I lacked the experience with these technologies to understand what was happening, or where the problem(s) were coming from.

I decided to eliminate the suspects one by one. I removed rvm and all traces of ruby from my system and installed ruby 1.8.7 the old-fashioned way, and got my little side projects up and running in that environment (as they had worked before). That gave me a baseline for exploring the new items, which I still want to learn about and use.

I began my investigation with Sinatra, running it under the (to me) more-familiar ruby 1.8.7. I observed the same odd behavior regarding the main app file, and it became obvious at that point that the public/private issue had to do with Sinatra and not with ruby 1.9.2. It seems to have something to do with the way Sinatra inserts its magical code under the covers.

I found a gem called cucumber-sinatra that generates a skeleton directory structure and an env.rb file tailored to work with Sinatra. Rather than trying to write my own env.rb from scratch, as I had been doing, I let cucumber-sinatra do its thing. Still no luck: It was either run the app or run the cukes, but not both.

The env.rb file generated by cucumber-sinatra looked like this:
# Generated by cucumber-sinatra. (Wed Nov 10 16:38:55 -0500 2010)
ENV['RACK_ENV'] = 'test'

require File.join(File.dirname(__FILE__), '..', '..', 'lib/my_app.rb')
require 'capybara'
require 'capybara/cucumber'
require 'rspec'

Capybara.app = MyApp

class MyAppWorld
include Capybara
include RSpec::Expectations
include RSpec::Matchers
end

World do
MyAppWorld.new
end
This still had the same odd behavior regarding inherited public methods. I was getting better at using Gemfile and bundle, but was no closer to having a usable environment. I found a github page by Aslak Hellesoy that had a slightly different sample env.rb file for cucumber-sinatra. It looked like this:
app_file = File.join(File.dirname(__FILE__), *%w[.. .. app.rb])
require app_file
# Force the application name because polyglot breaks the auto-detection logic.
Sinatra::Application.app_file = app_file

require 'rspec/expectations'
require 'rack/test'
require 'webrat'

Webrat.configure do |config|
config.mode = :rack
end

class MyWorld
include Rack::Test::Methods
include Webrat::Methods
include Webrat::Matchers

Webrat::Methods.delegate_to_session :response_code, :response_body

def app
Sinatra::Application
end
end

World{MyWorld.new}
All that "app_file" business near the top of the file pertains to the plain script style of a Sinatra app file; that is, not a subclass of Sinatra::Base. I was happy to see the example because it suggested a way to set things up such that both cucumber and a web server could understand the file. Using this as an example, I set up an env.rb file for a small test app like this:
ENV['RACK_ENV'] = 'test'
app_file = File.join(File.dirname(__FILE__), '..', '..', 'lib/my_app.rb')
require app_file

Sinatra::Application.app_file = app_file

require 'rspec/expectations'
require 'rack/test'
require 'webrat'

Webrat.configure do |config|
config.mode = :rack
end

class MyWorld
include Rack::Test::Methods
include Webrat::Methods
include Webrat::Matchers

Webrat::Methods.delegate_to_session :response_code, :response_body

def app
Sinatra::Application
end
end

World{MyWorld.new}
With this env.rb file, I can run
bundle exec cucumber features
and I can run the app in a web browser. I'm not crazy about it and I don't fully understand how it works, but at least it works and I can proceed with development while gradually learning more about Sinatra.

I posted a question on Twitter about these problems, and three people offered help. But they're not at my beck and call, and I need to learn about these things anyway.

Now that I have a working ruby 1.8.7 environment again, my next step will be to install rvm and bring up a 1.8.7 environment, then to ensure everything that's working now works the same way in that environment. That will give me a basis to explore ruby 1.9.2 with a bit more clarity about where the differences lie. Once I get rvm working properly, I can install 1.9.2 under its control without losing my functional 1.8.7 environment. All good; but it will take this noob some time to get there.

Next: Success with rvm and ruby 1.9.2

Monday, November 8, 2010

Ubuntu 10.04 upgrade: Summary

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: TrueType fonts & VSM font

I had no problems following the basic installation procedure guided by the installation disk. Differences I noticed:

  1. 9.04 did not recognize the integrated Bluetooth adapter in my Toshiba Satellite laptop. 10.04 also does not recognize it.

  2. 9.04 did not wake up from sleep after I closed the lid on the laptop. 10.04 works properly.

  3. 9.04 did not shut down the computer on shutdown, and did not restart Ubuntu on restart. 10.04 works properly.

  4. 9.04 supported the internal microphone on my laptop. 10.04 does not support the internal microphone. I found a bug report here: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/584051 and it appears as if the bug is not considered important. I bought an inexpensive headset and found that 10.04 works fine with the external microphone.

The biggest change is that Ubuntu no longer comes with a pre-installed Java JDK. The official JDK from Oracle is available from the Canonical partner repository. Since it is no longer free software (in the FSF sense), it cannot be part of the basic Ubuntu multiverse. The Ubuntu community recommends Open JDK, but I installed the Oracle version. No doubt the day is coming when I will switch. Same sort of thing applies to OpenOffice and MySQL. Free alternatives exist for both.

Next: Ruby 1.9.2, rvm, and Sinatra follies

Wednesday, November 3, 2010

Ubuntu 10.04 upgrade on Toshiba Satellite: TrueType fonts & VSM font

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: Instiki wiki

To install some favorite TrueType fonts, I installed the basic TT font package:
sudo apt-get install msttcorefonts


To install the very handy Value Stream Mapping font from Ambor, I followed the procedure documented in this blog entry.

Next: Ubuntu 10.04 upgrade: Summary

Tuesday, November 2, 2010

Ubuntu 10.04 upgrade on Toshiba Satellite: Instiki wiki

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: Ruby Version Manager

Recent practice migrating my wiki on the Acer netbook made the process go smoothly on the Toshiba.

First step was to install prerequisites::
sudo apt-get install
libxml2-dev
libxslt1-dev
sqlite3
libsqlite3-dev
gem install sqlite3-ruby
Then, I downloaded the latest Instiki from http://instiki.org/ and unpacked the tarball. I copied the instiki directory to /home and renamed it .wiki. Next, I changed to the .wiki directory and ran
ruby bundle
Finally, I renamed the installed db and public directories to db-shipped and public-shipped, and copied the db and public directories from my wiki backup. Instiki came up clean the first time.

Now to get my wiki startup and shutdown scripts working. I copied the icon, instiki.png, to the new .wiki directory. Created a .bin directory in /home and copied the wiki and wiki_stop scripts there. The new directory structure was different, so I edited the scripts accordingly.

My shutdown script didn't work, and after some experimentation I realized that instiki startup is a bit different than it used to be. Previously, it printed the pid to stderr, and I picked it up with awk to generate a shutdown script on the fly. This version of Instiki appears not to do that, so I need to work out another way to handle shutdown nicely. Not worth pursuing at the moment.

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: TrueType fonts & VSM font

Ubuntu 10.04 upgrade on Toshiba Satellite: Ruby Version Manager

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: Skype

Installation of rvm went pretty smoothly after the practice I got installing it on the Acer netbook. First step was to install prerequisites:
sudo apt-get install
curl
git-core
build-essential
zlib1g-dev
libssl-dev
libreadline5-dev
Next step was to run curl to do the basic install of rvm:
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
Then I edited .bashrc and commented out the line
[ -z "$PS1" ] && return
I noticed I had made a mistake when adding the source line to .bashrc on the Acer. The line should be
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
After that, I executed .bashrc like this
. ./.bashrc
and when I ran
type rvm | head -n1
I got the response
rvm is a function
just as the original instructions said to expect.

Next I ran
rvm install 1.9.2
and it downloaded and installed ruby 1.9.2 and rubygems 1.3.7.

At this point ruby -v said "The program 'ruby' is currently not installed". After I ran
rvm --default 1.9.2
then ruby -v said "ruby 1.9.2p0..." and gem -v said "1.3.7".

I uncommented the line
[ -z "$PS1" ] && return
in .bashrc to see if my guess was right about reinstating it after rvm had been used once. I closed the Terminal window and opened a new one, and ruby -v still worked. I logged out and in again, and ruby -v still worked.

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: Instiki wiki

Ubuntu 10.04 upgrade on Toshiba Satellite: Skype

Ubuntu 10.04 upgrade on Toshiba Satellite: Adobe Flash Player

The last time I checked, there was no 64-bit Skype client for Linux. On http://www.skype.com/intl/en-us/get-skype/on-your-computer/linux/ I found a beta version available, and they showed a 64-bit version available. I downloaded it to give it a try.

No instructions were provided, but I saw by the filename that it was a .deb file. Fellow noobs might recall that Ubuntu is descended from Debian, so we can use Debian utilities on Ubuntu. In Terminal, I ran the following command:
sudo dpkg -i skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
The installer complained of missing dependencies. I tried apt-get install on the exact names of packages the installer listed:
sudo apt-get install
lib32stdc++6
lib32asound2
ia32-libs
libc6-i386
lib32gcc1
Ubuntu could find no installation candidate for any of these packages.

An Internet search brought me to http://blog.mypapit.net/2007/06/how-to-install-skype-on-ubuntu.html, which mentioned adding deb http://download.skype.com/linux/repos/debian/ stable non-free to Synaptic Package Manager.

I made a backup of /etc/apt/sources/list
cd /etc/apt
sudo cp sources.list sources.list.backup
and edited the file, adding the repository at the end.

When I tried the apt-get install command above, everything was found except list32stdc++6. Another Internet search took me to http://ubuntuforums.org/showthread.php?t=1457771, where someone had reported a similar problem and later posted that an update had fixed it. I tried
sudo apt-get update
but the update complained that it could not find http://download.skype.com/linux/repos/debian/dists/stable/non-free/binary-amd64/Packages.gz.

I went back into /etc/apt/sources.list and commented out the line for that repository, then tried the update again. No complaints, so I tried
sudo apt-get install lib32stdc++6
This time it complained about unmet dependencies, and suggested running this:
sudo apt-get -f install
This did quite a lot, including installing or updating all the dependencies the dpkg command had complained about. It took a while.

To my surprise, it installed the Skype client as well. I called my wife, and she could see me but not hear me. I could see and hear her. We were unable to resolve the problem. Afterwards, I browsed the Internet and eventually found a bug report at https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/584051 that said the internal microphone on Toshiba Satellite laptops doesn't work under Ubuntu 10.04 due to a bug in the alsa driver. It's low priority and they may or may not fix it. Other postings online suggest an external microphone will work. I might try that later.

Ubuntu 10.04 upgrade on Toshiba Satellite: Ruby Version Manager

Ubuntu 10.04 upgrade on Toshiba Satellite: Adobe Flash Player

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: Prep and basic install

At the time of this installation, Adobe Flash Player for 64-bit Linux systems was still in a preview release. I went to http://labs.adobe.com/downloads/flashplayer10.html and downloaded the tarball for Linux. No installation instructions were provided.

When I unpacked the tarball, I found it contained a single file: libflashplayer.so. The filename jogged my memory, and I looked on this blog for previous notes about installing a non-production version of Flash Player with Firefox. I found it in this blog entry, and copied libflashplayer.so to /usr/lib/mozilla/plugins and restarted Firefox.

Gold!

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: Skype

Ubuntu 10.04 upgrade on Toshiba Satellite: Prep and basic install

Previous: Ubuntu 10.04 upgrade on Acer netbook: Instiki migration

The "upgrade" consisted of a fresh install of Ubuntu 10.04. To prepare for the install, I did the following:
  1. Cleaned up files and directories.
  2. Moved Gnome .desktop files for certain apps from /usr/share/applications to ~/.local/share/applications.
  3. Backed up my /home and /usr directories to an external hard drive
I learned a couple of lessons in the past few months of using Ubuntu. First, I learned that it's possible to define .desktop files under one's home directory. I moved some of these so that they could be backed up and restored with my /home directory. I also learned that there's no particular benefit in a separate partition for /usr.

Before committing to the new release, I ran 10.04 from the installation disk without doing the actual install. I was pleased to see that the 5100 AGN wireless adapter was supported. Everything looked okay to go forward with the installation.

Based on lessons learned, I defined partitions as follows:
ext4    30.0 GB    /        /dev/sda1
ext4 362 GB /home /dev/sda6
swap 8 GB /dev/sda5
The installation went smoothly. I restored /home from the backup.

I checked to see if 10.04 might support the integrated Bluetooth adapter in the laptop, but unfortunately it does not.

I opened a presentation file that contains images to see whether the bug related to hardware graphics acceleration had been fixed in OpenOffice 3.2. Yes!

I opened Firefox and saw that it is now branded as Firefox instead of Shiretoko. Good! I went to http://www.xmarks.com and installed the plug-in, then synced my bookmarks.

On the local system, I went to System -> Preferences -> Appearance and changed the Theme to Radiance.

Next: Ubuntu 10.04 upgrade on Acer netbook: Adobe Flash Player

Ubuntu 10.04 upgrade on Acer netbook: Instiki migration

Previous: Ubuntu 10.04 upgrade on Acer netbook: Ruby Version Manager and Ruby 1.9.2

One final check on the Acer before attempting this install on the Toshiba: Will my local Instiki wiki run under ruby 1.9.2?

First, I installed the usual prerequisites:
sudo apt-get install
libxml2-dev
libxslt1-dev
sqlite3
libsqlite3-dev
gem install sqlite3-ruby
Then, I downloaded the latest Instiki from http://instiki.org/ and unpacked the tarball.

When I started Instiki, it complained:
Bundler couldn't find some gems. Did you run 'bundle install'?
This hasn't happened before in my experience, so I assume it has something to do with running ruby under rvm vs. running it native.

I did an Internet search for 'instiki bundle install' and found useful information at http://golem.ph.utexas.edu/wiki/instiki/show/installation. After reading that information, I thought I had everything in place to run the bundle command, so I ran it from the instiki root directory:
ruby bundle
No complaints, so I started Instiki and it came up clean.

I shut down Instiki and copied the 'public' and 'db' directories from my old wiki (still on the Toshiba) to the one just installed on the Acer. This was sort of a risky short-cut, since I didn't follow any of the instructions for migrating the database. When I started Instiki, it came up clean. Apparently there have been no changes to the basic database structure since the last release. (Whew!)

I noticed that they've added a 'Skip the navigation links' link as the first link in the navigation bar of Instiki. That's a nice accessibility feature and a convenience for anyone who prefers the keyboard to the mouse. Kudos.

At this point, it looked as if Ubuntu 10.04 was okay for the Acer.

(Actually, Ubuntu has been more than just 'okay' for the Acer. IMHO it's a very good environment for a netbook. It's functional, simple, clean, relatively safe, and supports all the usual social networking tools. OpenOffice provides the tools I need to make presentations and so forth when on the road. A $200 machine with a free operating system and all the applications I need ... ideal for the purpose.)

Open questions about how 10.04 would run on the 64-bit Toshiba and whether it would support the wireless adapter could only be answered by installing it on that machine. Installing typical development tools should be no different on either machine, and since I don't use the Acer for development there was no value in going any further with those installs.

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: Prep and basic install

Monday, November 1, 2010

Ubuntu 10.04 upgrade on Acer netbook: Ruby Version Manager and Ruby 1.9.2

Previous: Ubuntu 10.04 upgrade on Acer netbook: Adobe Flash Player

The things I had done so far on the Acer did not tell me much about how 10.04 would play on the Toshiba. I was leery of 5100 AGN support, and the Adobe Flash Player for 64-bit Linux was still in a pre-release state.

Installing software development tools ought to be less problematic than all that. I found that many people were singing the praises of Ruby Version Manager (rvm). It gives you the ability to run multiple releases of ruby on the same machine without having to uninstall and install different releases. It sounded useful, and most of the comments online were very positive.

Following advice on http://web2linux.com/installing-rails-3-on-ubuntu-10-04-lucid-lynx/, I began by installing prerequisites to rvm and ruby:
apt-get install
curl
git-core
build-essential
zlib1g-dev
libssl-dev
libreadline5-dev
I then proceeded to make a series of noob mistakes, and after cleaning off various partial and incorrect installs, this is how I got rvm working. The official installation instructions at http://rvm.beginrescueend.com/rvm/install/ are pretty good, but are not exactly right.

The installation instructions mention three options — install as user, install as root, and system-wide install. I wanted to install as user so that everything would be under /home. That makes it easier to upgrade Ubuntu, since I can restore /home from a backup after doing the basic install. That was my plan for the Toshiba, anyway. For the Acer, I just blew everything away and installed fresh.

First step was to use curl to get the latest version of rvm from head:
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
This step appeared to work. The author, Wayne Seguin, kindly included the following advice in the console output: "Be sure to get head often as rvm development happens fast." Sound advice.

They suggest running
rvm notes
to install dependencies, but in fact it only displays a description of dependencies.

They say you must not have any returns in .bashrc. They specifically call out a line in Unbuntu's .bashrc:
[ -z "$PS1" ] && return
and they recommend wrapping this in an if structure so that rvm will work correctly. I found that after completing the rest of the installation steps, rvm never worked. It turned out that this change is required only for the installation process, and once rvm has been installed you should reinstate the original statement. I changed it to
if [[ -n "$PS1" ]] ; then
return
fi
and afterwards changed it back to
[ -z "$PS1" ] & return
The installation instructions also say to put this line at the end of .bashrc:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
They then say you have to run
source ~/.rvm/scripts/rvm
the first time you use rvm. In fact, you have to run this command every time you want to use rvm. I added the source command to the end of .bashrc, and rvm now works properly.

The other thing to be aware of is that the installation instructions say you run
type rvm | head -n1
and it should display
rvm is a function
Then, you run the source command for the first time. In fact, that results in
rvm is hashed (/usr/local/bin/rvm)
You have to run the source command first, and then rvm will be a function.

Finally rvm was working. I used it to install ruby 1.9.2:
rvm install 1.9.2
and then to make 1.9.2 the default version of ruby (as far as rvm was concerned, anyway):
rvm --default 1.9.2
Good news: It installed rubygems automatically.

Now I could install other gems and run ruby to my heart's content, but only when running as 'user'.

Next: Ubuntu 10.04 upgrade on Acer netbook: Instiki migration

Ubuntu 10.04 upgrade on Acer netbook: Adobe Flash Player

Previous: Ubuntu 10.04 upgrade on Acer netbook: Basic install

I went to YouTube and chose a video at random from the default page. As expected, it prompted me to install the Adobe Flash Player. I clicked on the Adobe link and it took me to the Adobe download page, as expected. There was a 32-bit Linux download for APT, so I chose it. It prompted me to enable the 10.04 Partner Channel. This enables downloads of non-free software for Linux. You must enable this to download the Flash Player. After that, it prompted me for my root password.

After a rather long wait, during which the system gave no indication that anything was happening, I was prompted with the Install Additional Software? dialog, asking Do you want to install package 'adobe-flashplugin'? I chose Install, and the installation appeared to work fine. When I tried the YouTube video again, it prompted me again to download the Flash Player, as if it couldn't find the one I had just installed. This time, I clicked on the Install Additional Plugins link instead of the Install Adobe FlashPlayer link.

This time, I got a list of available plugins. I highlighted Adobe Flash Player (installer) and clicked Next. That brought up the Install Additional Software? dialog, asking Do you want to install package 'flashplugin-installer'? I clicked Install. It removed the adobe-flashplugin package I had just installed, and installed flashplugin-installer. This took a long time. The installation appeared to work.

Now I was able to play YouTube videos.

So, the key to success here is to use the Install Additional Plugins link instead of the direct link to Adobe.

Next: Ubuntu 10.04 upgrade on Acer netbook: Ruby Version Manager and 1.9.2

Ubuntu 10.04 upgrade on Acer netbook: Basic install

Previous: Border around images in OpenOfficeImpress

Time for me, a not-on-the-bleeding-edge user, to upgrade to Ubuntu 10.04. I had problems using 9.10 on my Toshiba laptop due to problems in support for the Intel 5100 AGN wireless adapter. Various bugs were reported regarding Linux support for that product. I've been running 9.04 on the Toshiba and 9.10 on the Acer netbook. Oddly, 9.04 supports the 5100 AGN just fine, while later releases do not.

The Toshiba is my main workhorse, and I use the Acer for presentations and meetings as well as a host for a Windows XP instance that I need for two particular applications. Because it's easy to install Ubuntu alongside Windows using Wubi, I decided to approach the upgrade cautiously by installing on the Acer first. My thought was this would minimize the risk of messing up my primary machine. This approach would not tell me whether 10.04 supported the 5100 AGN wireless adapter, or whether it would be possible to get the 64-bit version of Adobe Flash Player working, but it would at least identify any major issues with the new release.

The Wubi install is different from a straight install from an iso disk. I booted into Windows XP, downloaded the Wubi installer, and ran it with
wubi --32bit
The installer recognized that Ubuntu was already installed and offered to remove it. I chose Yes, the installer removed Ubuntu 9.10, and exited. I ran the command a second time, exactly the same way, and this time it downloaded the installation files and proceeded with the installation. This took quite a while, but completed without any problems.

The first thing I noticed was that it was hard for me to read the display and to distinguish the edges of windows. It seems the default desktop theme for 10.04, Ambiance, is based on a color palette of black, dark black, deep black, and pitch black. I changed the desktop theme to Radiance, which has a lighter color palette. The default on 9.04, Human, was not listed as an option. Radiance is similar.

Now that I could read the display, the next order of business was to slow down the mouse a bit. By default, 10.04 ships with the mouse set to very fast and very sensitive; that is, the sliders are about half-way between minimum and maximum. I changed the settings to be more compatible with my slow, old hands, after some difficulty in making the mouse cursor land where I wanted it.

The next thing I noticed was that .bash_aliases is called by default from .bashrc. In 9.04, those lines are commented out by default in .bashrc. I think the 10.04 default makes more sense. I put some of my favorite aliases into .bash_aliases and began to check out the new version of Ubuntu.

Next: Ubuntu 10.04 upgrade on Acer netbook: Adobe Flash Player