This fix is for anyone that had NetBeans 6.9.1 already installed, and decided to add support for Ruby 1.9.2, Rails 3.0.0, and MySql adapter 2.8.1 on Windows XP.
That was my configuration, but it didn’t work properly. A Rails project creation always ended with an error about a non existing mysql2 gem. After some research, today I discovered that such an adapter is still to be released for Windows! So I dug into the NetBeans configs and came up with this fix that eventually allows me to cleanly create a Ruby on Rails 3.0.0 project.
- Install Ruby 1.9.2
- Install the Rails 3.0.0 gem
- if you also had installed a Rails 3.0.0 release candidate or other versions with a 3.0.0 prefix, it’s better to remove all but the 3.0.0, because NetBeans always shows only the 3.0.0 prefix for any of them, making it impossible to select the Rails version from the NetBeans dialog box for creating a project
- Install the mysql 2.8.1 gem
- Install all the Ruby category plugins into NetBeans 6.9.1
- Start a fresh NetBeans and create a demo project, like this:
- If the demo project creation ends without any error, then you’re lucky, and there’s no reason to continue reading…
- Explore the folder (Ruby folder)librubygems1.9.1gemsrailties-3.0.0librailsgeneratorsrailsapptemplatesconfigdatabases
- Copy and paste the file mysql.yml
- Rename the copy as mysql2.yml
- Edit the file mysql.yml
- Replace any occurrence of mysql2 with mysql
- Save and close the file
- Explore the folder (Ruby folder)librubygems1.9.1gemsrailties-3.0.0librailsgeneratorsrailsapp
- Edit the file app_generator.rb
- Find the line
- Replace it with the following
- Save and close the file
- Edit the file app_generator.rb
- Go to 5.
That’s all. I hope it’ll work for you too 🙂