Skip to content


Subversion checkout URL

You can clone with
Download ZIP


luislavena edited this page · 45 revisions

Having a problem when installing or using RubyInstaller? Life is full of glitches and details, we all know that.

Here you’ll find a list of the common issues some users have experienced and some guidance to help solve them. Please feel free to add your own experiences and resolutions!

For further help, refer to the rubyinstaller email group

Troubleshooting Details

When compiling gems, it complained about missing ruby.h file

We discovered that under some scenarios, users that previously had Cygwin installed in the system are affected during installation of gems that require compilation.

Please check that no leftover of your cygwin install remains in your home directory, specially any .bash_profile or .bashrc file.

You can read more about this issue on this thread

Can’t install gems due `Errno::EEXIST` errors under Windows 7

There has been reports of users unable to install any gem unless UAC is disabled or the command prompt is executed as Administrator.

Users facing this issue are Windows 7 Ultimate (32bits) that in the majority upgraded from previous Release Candidate to RTM versions.

Microsoft KB970789 might provide some details (under the manual section) to fix the issue.

Another alternative, while radical, is format the NTFS harddrive where Ruby is installed.

This is not a Ruby or RubyInstaller issue but instead one from incorrect filesystem permissions.

Another source of this issue could be the installation of either Cygwin or E-Text Editor, as described here and better findings here

Looks like VirtualStore folder looses the proper permissions and is locking out any 32bits application running on Windows x64 bits due the automatic file redirection.

For some strange reason, it fails to install gems.

There might be lot of reasons why it could fail. Either the gem require compilation, which means the installation of Development Kit, the gem is not compatible with the platform (see Gem List for compatibility) or there is another unknown error.

When installing a gem, if it fail, please take a closer look to the output of gem env command:

RubyGems Environment:
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby187/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: C:/Ruby187/bin/ruby.exe
    - ruby
    - x86-mingw32
     - C:/Ruby187/lib/ruby/gems/1.8
     - C:/Users/Luis/.gem/ruby/1.8
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => [""]
     - "install" => "--no-ri --no-rdoc --env-shebang"
     - "update" => "--no-ri --no-rdoc --env-shebang"

Specially, pay attention to INSTALLATION DIRECTORY and GEM PATH

If you notice a directory with spaces there, it might be because you installed Ruby in a folder with spaces (highly not recommended) or because another environment variable in your system is interfering.

Please check that HOME variable is actually pointing to your home folder. use GEM_HOME and GEM_PATH to alter where RubyGems install gems, read their docs here

See another example of this issue here

Mix and matching of RubyInstaller with cygwin will fail.

To be able to install and compile certain RubyGems with RubyInstaller, you need to have the Development Kit installed. While the DevKit is based on MinGW and MSYS, it is not recommended use a different version than the one provided by RubyInstaller Team.

Do not confuse MSYS with Cygwin. While Cygwin contains GCC, make and other tools also available in the Development Kit, is not the same and having it in the PATH will interfere with the correct behavior of RubyInstaller.

At all times avoid having cygwin in your PATH when working with RubyInstaller and the Development Kit.

All installed fine but can’t compile gems under Vista

Under certain versions of Windows Vista, you might find unable to compile gems even after correct installation of RubyInstaller and the DevKit.

If you receive this message:

C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed
to generate an executable file. (RuntimeError)
You have to install development tools first.

And you dig into mkmf.log (found inside the gem directory) you will see something like this:

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/include/ruby-1.9.1/ruby/backward
-IC:/Ruby192/include/ruby-1.9.1 -I.     -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith 
-Wwrite-strings -Wno-missing-field-initializers -Wno-long-long conftest.c  -L. -LC:/Ruby192/lib -L.      
-lmsvcrt-ruby191-static  -lshell32 -lws2_32  "
gcc: CreateProcess: No such file or directory

Which indicates an error of GCC to invoke one of it’s internal processes. A simple workaround to this issue will be add an special directory to the PATH, like this:

SET PATH=%PATH%;C:\DevKit\mingw\libexec\gcc\mingw32\4.5.1

Please adjust C:\DevKit accordingly to your DevKit installation directory and 4.5.1 to the version of the DevKit you installed (e.g. 3.4.5, 4.5.1).

This is a known bug of GCC on Windows Vista and a request for better message already exist for MinGW project.

You can find all the details of this issue in this thread on our group.

ERROR: Failed to build gem native extension

You’ve installed both RubyInstaller and DevKit following the instructions but during gem installation, you receive a message like this:

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

C:/ruby/bin/ruby.exe extconf.rb
C:/ruby/bin/ruby.exe: No such file or directory -- extconf.rb

Or sometimes just this:

ERROR:  Error installing rdiscount:
       ERROR: Failed to build gem native extension.

       C:/Ruby187/bin/ruby.exe extconf.rb

This has been reported to our group here and here.

After a long back and forth investigation, we found two possible causes for this issue: COMSPEC environment variable (scenario A) and AutoRun registry setting (scenario B), both described below:

Scenario A

Using a command prompt, invoke the following command:


If in the output you see something different than cmd.exe as value for that variable, then please adjust it to use cmd.exe

Some tools might change your command processor command, which interferes with Ruby invoking child processes.

Change that and try to install the gem again.

Scenario B

If the problem persist, invoke the following commands in the same command prompt:

REG QUERY "HKCU\Software\Microsoft\Command Processor"
REG QUERY "HKLM\Software\Microsoft\Command Processor"

Execute each line individually. Once you run it, will see something like this:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    CompletionChar    REG_DWORD    0x9
    DefaultColor    REG_DWORD    0x0
    EnableExtensions    REG_DWORD    0x1
    PathCompletionChar    REG_DWORD    0x9

The columns of information are Key, Type and Value. If you see a key named AutoRun, there is a chance this is the culprit of the error you’re receiving.

AutoRun interferes with Ruby messing with child process executing and by result, affecting gem installation. Please remove it with the following command:

REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun

Once you’re done, try opening a new command prompt and executing gem installation again.

Executing gem or Ruby generates random segfaults

Under certain versions of Windows, specially on Server editions, you might encounter that Ruby generates random segfaults attempting to use extensions like zlib or openssl, which are normal when using RubyGems.

Symptom: invoking gem install will produce something like the following:

C:\Users\sysadmin>gem install mysql
C:/Ruby186/lib/ruby/1.8/i386-mingw32/ [BUG] Segmentation fault
ruby 1.8.6 (2010-02-04) [i386-mingw32]

If that is the case, DEP might be interfering with Ruby extension loading mechanism. DEP is on by default in the Server editions of Windows.

This is covered by KB875352 which provides you details on different modes of execution.

At this time, Ruby executable needs to be added to DEP exclusion list for it to work properly. Please see your Operating System documentation (or the above Knowledge Base article).

Cannot install mysql or mysql2 gem with my system MySQL

This issue normally happens under 64bits editions of Windows with 64bits installations of MySQL server (5.0, 5.1 or 5.5)

RubyInstaller, at this time is provided only in 32bits, meaning that it cannot link or use 64bits libraries like libmysql.dll present in a 64bits installation of MySQL.

To workaround this issue, you need to download a 32bits version of these libraries and use them during gem installation:

gem install mysql --platform=ruby -- --with-mysql-include=X:\include --with-mysql-lib=X:\lib\opt

Where X:\ needs to be replaced with a path without spaces where the 32bits version of MySQL was extracted. --platform=ruby will force the compilation and avoid the installation of the binary version of the gem. Remember to uninstall any previous version using gem uninstall mysql --all before.

If you can’t find a 32bits version of MySQL, I recommend you download MySQL Connector/C, which is an independent version of libmysql.dll that do not tie you to a version specific MySQL API.

Once compiled and installed, copy libmysql.dll from lib into your Ruby’s bin directory.

You can find a complete walk-through of both MySQL Server installation and the gem installation on this post

Something went wrong with that request. Please try again.