Developing for Multiple Ruby Versions

When developing for multiple ruby versions, such as 1.8.x and 1.9.x, it is convenient to have separate command prompts open, one for each ruby version. To do so for win32/64 platforms, create separate batch files for each ruby version installed and add something along the lines of

set Path=c:\ruby186\bin;%Path%
cmd

This will open a new command prompt configured for the desired ruby version. Note, it does not matter if your Path environment variable contains additionally paths to ruby, since the desired ruby path is prepended to ensure precedence over whatever follows.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s