Pik: can’t dup NilClass

There is a way to install multiple versions of Ruby on Windows, just like the famed RVM for Linux. It is called Pik. A fantastic piece of software, yet I got some “There was an error. Error: can’t dup NilClass” messages while trying to use it at first. To avoid that, and fix it if you’re stuck there, here is what you’ll want to do:

You have to have ruby pre-installed to use this version manager, which is odd, since that is the whole point of installing a version manager, is to manage the version, without installing it first. Such is the convoluted world of software as we know it. Sometimes you have to be a happy sea lion, wear your troubleshooting hat, and deal with it.

I recommend installing Ruby 1.8.6 or something basic to get Pik working, but it shouldn’t matter which version too much. Download Ruby 1.8.6 if you need to here.

During the install, you need to change the default install directory to C:\Ruby, without the 186 on the end of it, or pik won’t work right. For those dozing off right now, It must be c:\ruby alone, because pik is looking for some ruby files to run in c:\ruby, not in c:\ruby186 or c:\>ruby192. Bad rubystaller bad!

At your C:\> prompt, type this in or click copy, right-click, click paste.

msiexec /i http://github.com/downloads/vertiginous/pik/pik-0.2.8.msi

You can and should replace the 0.2.8 with whatever vertiginous’s latest version msi on github, but for now this one is the best.

It will launch an installer. Finish the install, and make sure you put the files in the default C:\pik folder.

Once this is done, you should be able to launch a command line and type pik at the prompt.

For the rest of how to install Ruby’s multiple versions on Windows, I refer you to vertiginous’s original tutorial (scroll down to the section where it talks about installing ruby, switching versions, etc. I had to fight through this portion via trial and error, and thought it may help you get through the part that he doesn’t mention on how this works. Enjoy.

, , , , ,

Leave a Reply

You must be logged in to post a comment.