Upgrading to Ruby 1.9.3 and Rails 3.2 on Windows

My Windows machine had ruby 1.9.2 and Rails 3.1. Now that ruby 1.9.3 and rails 3.2 are out, it was time to upgrade. This method isn’t the easiest, but it worked just fine for me. Note that this machine has MySQL version 5, so step 7 is necessary for me. If you have MySQL version 6, copy libmysql.dll from there if it isn’t already on the path.

1. Install the latest version of ruby (currently 1.9.3-p125)
  a. Follow the instructions on rubyinstaller.org
  b. I recommend you use the defaults (install to C:\ruby193)
  c. make sure to also install DevKit (install to C:\ruby193\DevKit)
2. install pik
  a. gem install pik
  b. pik_install C:\bin (or other directory that is always on your path)
3. Add this ruby to pik
  a. pik add C:\ruby193\bin
4. Use this version of ruby
  a. pik use ruby 1.9.3p125 (note: there is no dash between the version and the p)
     I put this in a batch file, rather than have it load automatically with cmd
5. gem install rails
6. gem install mysql2
7. copy version 6 of libmysql.dll to C:\ruby193\bin (same directory as this version of ruby.exe)
  a. download it from the site shown on the gem install mysql2
8. rails new yourproject -d mysql
9. cd yourproject
10. edit database.yaml so adapter is mysql2
11. bundle install

3 comments to Upgrading to Ruby 1.9.3 and Rails 3.2

  • Great post! Just one detail: if you install with bundler, the link to the dll is not shown (grrrrrrrr).
    http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick is the right one.

  • Murty

    This is what I am looking for. Some reason I can’t find enough posts on Pik but there are lot more conversations on RVM.

    I already have Ruby 1.9.3 and rails 3.2.11 installed on my windows 8 laptop. Can I still install Pik and use it to manage the current ruby and rails installs? Or do I have to reinstall the rails after installing Pik?

    Thank you.

  • pik can be installed before or after your next Windows Ruby install. The pik_install command makes it accessible as a general command outside of Ruby and gems.

    You can install pik via
    1. gem install pik
    2. pik_install C:\bin (or other directory that is always on your path)

    and then add Rubies as in the rest of this note and my January 13,2013 note.

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>