Skip to main content

Can not install Devise gem with Ruby 1.9.2 on windows

I was having a try out of devise gem with one of my Rails 3 pet project just yesterday. I installed Ruby 1.9.2 with the one-click installer from rubyinstaller.org and the latest Rails 3.0. But I faced installation problem as usual on windows. The problem was that it was not being able to build its native extensions.

After some research I found out the solution at http://github.com/oneclick/rubyinstaller/wiki/development-kit. What I was missing is development kit. I just followed the instruction and it was solved and installed devise with my Ruby 1.9.2 correctly.

But I am not sure whether it will work with Rails 3's bundle install command or not. I installed the gem from command line using the command gem install devise --platform=ruby before installing all the required gems with bundle install command . The last parameter platform is a must as it will temporarily use the DevKit to build native extensions. That's it.

Comments

  1. Thank you Ashif for taking the time to document install of Devise gem on Windows.

    Dennis Major

    ReplyDelete
  2. You are welcome Dennis. My pleasure...

    ReplyDelete
  3. Thank you very much, this was extremely helpful.

    ReplyDelete
  4. Ashif, Thanks for your post. I have tried following the steps here and run into a problem making the gem. I know this isn't a forum but perhaps you will be able to point me in the right direction.
    I am also on Ruby 1.9.2, Rails 3.0.2, Windows 7. I have both cygwin and the developer kit, and am able to install other gems successfully. Here is what I get when I try the above for devise:

    c:\>gem install devise --platform==ruby
    Temporarily enhancing PATH to include DevKit...
    Building native extensions. This could take a while...
    ERROR: Error installing devise:
    ERROR: Failed to build gem native extension.

    C:/Ruby192/bin/ruby.exe extconf.rb
    creating Makefile

    make
    make: *** No rule to make target `/C/Ruby192/include/ruby-1.9.1/ruby.h', needed
    by `bcrypt.o'. Stop.


    Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/bcrypt-ru
    by-2.1.2 for inspection.
    Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-2.1.2/ext/mri/
    gem_make.out

    c:\>

    Any thoughts on what would cause this?

    Many thanks and kind regards,

    -Sam

    ReplyDelete
  5. Hello Sam, sorry for the late reply. Been out for a vacation trip. Interesting that you are facing the issue as I followed the following installation steps for the devkit. Can you please follow the steps and let me know your result:

    * Extract the DevKit-4.5.0-20100819-1536-sfx.exe to a suitable location and cd on command prompt
    * now run the command: ruby dk.rb init and it will build a config.yml to that directory. Edit the config.yml file and comment out the line for the ruby versions for which you don't want to use the latest version of devkit. If you don't find the ruby installation directory you want to add, then you can add here as the example shown there.
    * now check the installation configuration using the command: ruby dk.rb review
    * And finally run the command: ruby dk.rb install
    If all the steps are completed successfully then use the command: gem install devise --platform=ruby

    Please let me know if you are still facing the issue.

    Thanks,
    Ashif

    ReplyDelete

Post a Comment

Popular posts from this blog

The contents of the feature's solution requires the Solution Sandbox service to be running

If you are developing any Sandbox solution for Sharepoint 2010, then you may have faced an error while deploying any solution to your development server. The error in Visual Studio 2010 output window looks like this generally:
Error occurred in deployment step 'Activate Features': This feature cannot be activated at this time. The contents of the feature's solution requires the Solution Sandbox service to be running.

The fix is simple. You must make sure that your "Sharepoint 2010 User Code Host" service is running. It is disabled by default installation. So, you have enable and run it. If you want to deploy the solution, then again you see the same error output. Actually, you have to make sure that this service's status is active in Central Administration Site. To see the status go to your Sharepoint 2010 Central Administration Application. Under System Settings > Manage services on server make sure that "Microsoft SharePoint Foundation Sandboxed Code…

Running ferret server with mongrel and shared index folder

If you are using acts_as_ferret plugin for searching in your rails application then you must have faced some issues with indexing or running ferret server on your production server. In this post, I will share with you some tips about running and maintaining ferret server: Running ferret server on productionSharing your ferret index folderWrite a simple script to re-index all your data

Running your ferret server
If you have multiple instances of mongrel running in your production, then you must need to run the ferret server to handle situations when multiple processes are updating ferret index at the same time. If you want to run ferret server in your production server, then at first you have to open the port you set in ferret_server.yml of your config directory on the server you want to run it. acts_as_ferret comes with a built-in drb server which uses dRuby protocol. So, you should remember to open the port with other protocol (not http or something else). One very important thing is t…