Friday, December 4, 2009

Configuring user gems installation directory


Configuring user gems installation directory


I found it useful to separate between system gems that come with ruby (eg…)and gems that I install by myself to either test them out or for personal projects. The separation allows to clean out the local user gems dir quite easily.

There are two relevant env variables that we will need to set this up. The are:
GEM_HOME - specifies where the new gems are to be installed
GEM_PATH - similar to java CLASSPATH, location where gems are to b found in a system

My first steps were to set those variables as follows:
export GEM_HOME=$HOME/ruby/1.9.1
export GEM_PATH=$GEM_HOME:/usr/local/lib/ruby/gems/1.9.1

However this did not work, when I tried to install a new gem (gem install XX) it installed it into the system gems directory (/usr/local/lib/ruby/gems/1.9.1)

Another suggestion I came across was to create .gemrc file in user home directory that contains the following:
gemhome: /Users/ilya/.gem/ruby/1.9.1
gempath:
- /Users/ilya/.gem/ruby/1.9.1
- /usr/local/lib/ruby/gems/1.9.1

Gems look for .gemrc in the user’s home directory each time it runs to load the necessary paths. This worked a treat.


GEM_PATH


The apps/scripts that are launched via calling “ruby ” and irb will not have the access to the variables set in .gemrc, hence I ensured I have GEM_PATH environment variable configured, and I unbound GEM_HOME, as its only used by “gem” command which reads the gemhome value from .gemrc.

Saturday, May 2, 2009

iPod players on Ubuntu Jaunty

Just got a squeaky new gen 4, 8 gigs iPpod Nano, a beautiful thing. After loading it up with my fav music I wanted to play it on my ubuntu box (running Jaunty Jackalope)- much better speakers there than on my laptop. Apparently its a pretty hard job. I tried about 5 ubuntu players:

Exaile 0.2.14, Amarock 2.0.2, Rythmbox 0.12.0, gtkpod 0.99.14, Songbird 1.12 with Ipod Device Support 3.0.12.1028 extension, Banshee 1.4.3.

I was shocked to find how hard it is to find a player that does what I expect any nice player to do.

I started with Exaile, installed it, but it just did not see my ipod :-(.

The next one was Amarock. I was glad to see that it recognized my ipod and I was able to browse music. But hey, can I see the play lists from my ipod? - No. I mean seriously, how do they think people use music players? Didn't see a way to synch my library to the comp.

Next, Rythmbox - same thing, shows the library with all tracks stacked up together and no playlists. No obvious way to save the library on the PC.

Gtkpod - I went to their website's downloads section, what do I find? Three main headings: Source (no thanks), Third-party packages - okay, how is this relevant, next - Package Search Machines. What can be more confusing? At the end I googled post by another noob struggling with a solution: sudo aptitude install gtkpod. Okay. Install - done, I load it up and finally a sigh of relief - my playlists come up, I can the library to PC, tracks are named nicely. So i'm thinking - done, lets play a track, I double click one randomly - nothing happens, I right click it, select 'play now' -> an error comes up saying something about xmms being unavailable. Basically it does not play tracks natively.

Next. Songbird. I download the files untar them, double clicking the executable didn't do anything, but executing the it from the command line worked and it loaded the player. The GUI is nice, but I did not see my ipod. Its powered by Mozilla, so I decided to persevere. After googling around I found the ipod extension, installed it and ... finally everything worked beautifully. Here is a post about how to get it to start without using command line.

Banshee. When I initially tried it it plainly refused to see my nano, but to my surprise after I accidentally synched the ipod with an empty library using Songbird, it started to recognise it, and it sees the playlists too!

To conclude I feel bad writing some of my negative impressions on few of these players, cause they all are open source, and I know some awesome developers have committed their evenings and weekends writing that code. But from end user point of view I found the whole process of finding a working player more lengthy than I initially thought, and somewhat frustrating.

In the end my personal favourites are gtkpod for synching the music database, and songbird with ipod extension for playing the music.

Have fun, enjoy music, keep writing & supporting the open source!