It is not clear if you attempted to mix RubyInstaller on top of RailsInstaller, which is not recommended.
However, the most common reason why this failed is simply because you installed it in a directory with spaces (Program Files (x86)
)
During installation, RailsInstaller sets a recommended default to install into C:\RailsInstaller
.
Similar to that, RubyInstaller strongly recommends avoid path with spaces for the installation (is in the installation screen)
Ruby and some libraries had issues with path with spaces, that is why the recommended installation directory is C:\Ruby193
for RubyInstaller 1.9.3
These spaces in the path affected compilation of libraries like C extensions and under some circumstances actually executing programs.
While the community has worked hard to correct these issues, is not until Ruby 2.0 that most of these issues has been ironed out for Ruby itself.
As documented in RubyInstaller Troubleshooting page
Specially, pay attention to INSTALLATION DIRECTORY and GEM PATH
If you notice those directories contain spaces, 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.
Directories with spaces often cause problems for the DevKit’s GCC
compiler.
Now, in your backtrace of the error:
C:/Program Files (x86)/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid switch in RUBYOPT: -F (RuntimeError)
It indicates something else is interfering with RUBYOPT
environment variable.
I recommend you uninstall these modifications and:
And then try again.
If you don't want to deal with the installation of all the components manually, perhaps you should try the same (clean installation with defaults) for RailsInstaller instead.
Please note that RailsInstaller already includes DevKit, so there is no need for separate installation.
Last but not least, it is important that if you download a separate DevKit, you use the correct one for the version of Ruby you installed. This is mentioned in RubyInstaller downloads page:
Down this page, several and different versions of Development Kits
(DevKit) are listed. Please download the right one for your version of
Ruby:
Ruby 1.8.6 to 1.9.3: tdm-32-4.5.2
Ruby 2.0.0: mingw64-32-4.7.2
Ruby 2.0.0 x64 (64bits): mingw64-64-4.7.2
Hope that helps.