Anyone who’s tried to install the Rails gem Devise on their Windows PC know that it’s not a smooth process – it takes a bit of massaging, requiring use of a development kit from the RubyInstaller For Windows website and a special parameter to be passed to the gem executable.
- Grab the latest version of the development kit, DevKit-4.5.0-20100819-1536-sfx.exe, from the RubyInstaller Downloads page.
- Run the self-extracting installer, placing all files to C:\devkit\ . Navigate to the directory and initialize the development kit by executing:
ruby dk.rb init
- Review the auto-recognized paths to ensure its accuracy:
ruby dk.rb review
- Finally, actually install the development kit add-ons:
ruby dk.rb install
- Now we’re ready to install our problematic gems! In the same directory, execute your gem command:
gem install devise --platform=ruby
You’ll note the include of the flag –platform=ruby in the last command listed above – it’s essential in avoiding a make issue inherent to the Windows environment. Also, bcrypt-ruby is installed as a requirement of the devise gem, so that’s two birds with one stone if you’re looking to make use of both. Enjoy!