HTTPS clone URL
Subversion checkout URL
Clone this wiki locally
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
- Missing ruby.h file
- Can’t install gems under Windows 7
- It fails to install gems
- Do not mix with Cygwin
- All installed fine but can’t compile gems under Vista
- ERROR: Failed to build gem native extension
- Executing gem or Ruby generates random segfaults
- Cannot install mysql or mysql2 gem with my system MySQL
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
You can read more about this issue on this thread
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.
VirtualStore folder looses the proper permissions and is locking out any 32bits application running on Windows x64 bits due the automatic file redirection.
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: - RUBYGEMS VERSION: 1.3.5 - 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 - EXECUTABLE DIRECTORY: C:/Ruby187/bin - RUBYGEMS PLATFORMS: - ruby - x86-mingw32 - GEM PATHS: - C:/Ruby187/lib/ruby/gems/1.8 - C:/Users/Luis/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - :sources => ["http://rubygems.org"] - "install" => "--no-ri --no-rdoc --env-shebang" - "update" => "--no-ri --no-rdoc --env-shebang" - REMOTE SOURCES: - http://rubygems.org
Specially, pay attention to
INSTALLATION DIRECTORY and
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_PATH to alter where RubyGems install gems, read their docs here
See another example of this issue here
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.
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:
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.
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 (LoadError)
Or sometimes just this:
ERROR: Error installing rdiscount: ERROR: Failed to build gem native extension. C:/Ruby187/bin/ruby.exe extconf.rb
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:
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
Some tools might change your command processor command, which interferes with Ruby invoking child processes.
Change that and try to install the gem again.
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.
Under certain versions of Windows, specially on Server editions, you might encounter that Ruby generates random segfaults attempting to use extensions like
openssl, which are normal when using RubyGems.
gem install will produce something like the following:
C:\Users\sysadmin>gem install mysql C:/Ruby186/lib/ruby/1.8/i386-mingw32/openssl.so: [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).
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
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
lib into your Ruby’s
You can find a complete walk-through of both MySQL Server installation and the gem installation on this post