Forum: Ruby Installing Ruby 1.9.1 Binary on Windows Vista

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-27 18:03
I've searched and only found one topic which did not have an answer or
explanation on how to install Ruby 1.9.1 Binary on windows.

Is there a "tutorial" or "documentation" on how to correctly install the
binary version on windows?

I find it hard to believe that some type of documentation would not be
available.  There is no one-click installer for 1.9.1 so I don't mind
doing it the old fashioned way if I knew how to do so properly.

Thanks.
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2009-05-27 20:41
(Received via mailing list)
On May 27, 1:03 pm, Joel Dezenzio <jdezen...@gmail.com> wrote:
> I've searched and only found one topic which did not have an answer or
> explanation on how to install Ruby 1.9.1 Binary on windows.
>
> Is there a "tutorial" or "documentation" on how to correctly install the
> binary version on windows?
>
> I find it hard to believe that some type of documentation would not be
> available.  There is no one-click installer for 1.9.1 so I don't mind
> doing it the old fashioned way if I knew how to do so properly.
>

This has been commented and discussed several times in this mailing
list by myself and my other developers.

You can go the mswin32 route which require you actualy READ the
install instructions at garbage collect site:

http://www.garbagecollect.jp/ruby/mswin32/en/
http://www.garbagecollect.jp/ruby/mswin32/en/docum...

Or, to stay DRY with my answers:

http://blog.mmediasys.com/2009/05/05/rubyinstaller...
http://blog.mmediasys.com/2009/05/17/rubyinstaller...
http://blog.mmediasys.com/2009/05/19/pure-ruby-rea...
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-27 22:39
Bookmarking those links - many thanks.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-28 00:36
> Is there a "tutorial" or "documentation" on how to correctly install the
> binary version on windows?

Here's my crack at a tutorial.
This is to install versions built with mingw (i.e. pre releases for the
one click installer).
http://programming-gone-awry.blogspot.com/2009/05/...
Cheers!
-=r
D4dc091694818db2a60b2752de6319f0?d=identicon&s=25 trehook@googlemail.com (Guest)
on 2009-05-28 14:20
(Received via mailing list)
Here's my crack at a tutorial.
This is to install versions built with mingw (i.e. pre releases for
the
one click installer).
http://programming-gone-awry.blogspot.com/2009/05/...
Cheers!

Hope it helps. For more information
http://groups.google.com/group/trevor-hook

Regards,
Trevor.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 14:49
Roger Pack wrote:
>> Is there a "tutorial" or "documentation" on how to correctly install the
>> binary version on windows?
>
> Here's my crack at a tutorial.
> This is to install versions built with mingw (i.e. pre releases for the
> one click installer).
> http://programming-gone-awry.blogspot.com/2009/05/...
> Cheers!
> -=r

Thanks Roger,

Can I ask one question though.  If I have previously used the installer,
do I need to "uninstall" that version completely before installing the
ming/1.9 version?

I didn't see that in your link instructions so just wanted to confirm
before going forward with the test.

Thanks.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 14:58
Actually I just did..

1.  renamed Ruby to Ruby.old
2.  Followed all the remaining instructions (with exception of the path
variables for ruby itself)
3.  Ran ruby -v and gcc -v and both worked fine.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 15:06
4.  Copied Scite into the new Ruby folder.
5.  Ran gem installs and everything is working fine thus far.
6.  Tested a few programs...

So, I believe that if you have the one-click installer already installed
(the path variables are already set).

If you follow all the instructions located in the link and then do what
I listed it does work fine.

If there are any potential flaws with this, please let me know but so
far everything is working...
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 15:16
One thing I definitely noticed like when I tried to install mysql I had
to do:

gem install mysql --platform=mswin32

and it worked fine..

With other files like ruby-opengl I had to go to the download page,
download the .gem file manually and install the gem locally and it
worked fine.

Testing apps and they all work fine.

Good information - this is exactly what I was looking for!
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-28 15:53
> Thanks Roger,
>
> Can I ask one question though.  If I have previously used the installer,
> do I need to "uninstall" that version completely before installing the
> ming/1.9 version?

Nope--you can have as many as you want on you system, just be aware that
"ruby gem installed commands" will use the first ruby they find in the
path, not necessarily the one they were installed with.  So it's ok to
have multiple versions just realize that it will by default use the
first one in the path.
-=r
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 16:30
The only issue I'm finding with upgrading is that some of the gem
binaries are built on another version so I get an error
msvcrt-ruby18.dll was not found.  I know it's occurring because I have
msvcrt-ruby191.dll now and the gem was built with 18 instead of 191.

That's the only downfall so far.

What I don't understand is why don't the gem authors force a certain
"require ruby version" when installing their gems so that we know which
ones are 18 and which ones are 191...

Having to fish for which gems are which and then having to go to the
authors to find a new source is a bit frustrating.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-28 18:49
J. D. wrote:
> The only issue I'm finding with upgrading is that some of the gem
> binaries are built on another version so I get an error
> msvcrt-ruby18.dll was not found.  I know it's occurring because I have
> msvcrt-ruby191.dll now and the gem was built with 18 instead of 191.

yeah it's a concern being discussed by the rubygems fellas.  For now
with 1.9 your only hope is basically to build "everything binary" from
scratch, which...works on and off.
-=r
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2009-05-28 19:16
(Received via mailing list)
On May 28, 10:16 am, "J. D." <jdezen...@gmail.com> wrote:
> One thing I definitely noticed like when I tried to install mysql I had
> to do:
>
> gem install mysql --platform=mswin32
>
> and it worked fine..
>

http://blog.mmediasys.com/2008/08/10/rubygems-with...

> With other files like ruby-opengl I had to go to the download page,
> download the .gem file manually and install the gem locally and it
> worked fine.
>

I believe that is a error in the published gem or how was published at
RubyForge. Please contact the gem developer/author and provide your
feedback.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 19:16
Roger Pack wrote:
> J. D. wrote:
>> The only issue I'm finding with upgrading is that some of the gem
>> binaries are built on another version so I get an error
>> msvcrt-ruby18.dll was not found.  I know it's occurring because I have
>> msvcrt-ruby191.dll now and the gem was built with 18 instead of 191.
>
> yeah it's a concern being discussed by the rubygems fellas.  For now
> with 1.9 your only hope is basically to build "everything binary" from
> scratch, which...works on and off.
> -=r

Well, I'm still new (only going into my second week of ruby).  I've
already read 1 book but reading/doing are two different things.

Do you have a link or something to that extent that shows how to build a
binary gem from start to finish?

I learn fast but unfortunately with something like this (on a first time
try) I'd be fishing in the dark...
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2009-05-28 19:21
(Received via mailing list)
On May 28, 11:30 am, "J. D." <jdezen...@gmail.com> wrote:
> The only issue I'm finding with upgrading is that some of the gem
> binaries are built on another version so I get an error
> msvcrt-ruby18.dll was not found.  I know it's occurring because I have
> msvcrt-ruby191.dll now and the gem was built with 18 instead of 191.
>

Yes, this is already exposed problem with RubyGems:

http://rubyforge.org/pipermail/rubygems-developers...

And suggestion to go with "Fat binaries" are a tempting option I'm
working on with original ideas form Aaron Patterson:

http://tenderlovemaking.com/2009/05/07/fat-binary-...

> That's the only downfall so far.
>
> What I don't understand is why don't the gem authors force a certain
> "require ruby version" when installing their gems so that we know which
> ones are 18 and which ones are 191...
>

Since RubyGems lack the ability to have 2 exact version number gems
(1.2.3) but targetting different Ruby versions (1.8.x, 1.9), renders
required_ruby_version kind of useless (as I pointed in RubyGems
mailing list).

> Having to fish for which gems are which and then having to go to the
> authors to find a new source is a bit frustrating.

Complain to the authors, or even better, patch and contribute the
changes.

Nothing else can be said since they are contributing for free with
their code for you to enjoy or be frustrated with.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 19:35
Being frustrated and complaining are really two different things.  I
don't mind being frustrated and I usually will work through issues the
best way that I can.  Once I'm up to par on Ruby and understand it much
better, I'd be happy to contribute.  I'm the type of person that loves
contributing.  Unfortunately, wanting to and knowing how to are also two
different things.

After upgrading to 1.9.1 one of the gems that I want to use is mysql.

When I require it, I receive the following message:

"The application has failed to start because msvcrt-ruby18.dll was not
found."

I know that is because I need to use msvcrt-ruby191.dll and that the gem
was built with another version.

So, how would I go (step by step) to trying to resolve the issues I'm
having with the mysql gem?  Or, rather, what would you do step by step
to resolve the issue?

Many thanks in advance.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-28 20:19
> So, how would I go (step by step) to trying to resolve the issues I'm
> having with the mysql gem?  Or, rather, what would you do step by step
> to resolve the issue?

Luis is working on a "download system" to help with dependencies,
hopefully released soon.

So there are some binary gems that don't have dependencies.
i.e.
install ruby + devkit
gem install eventmachine # builds and installs the binary

those that do have dependencies, you have to do more work (here's where
theoretically, the gem author could provide you with precompiled
binaries so you don't have to download the dependencies).  At least
that's how it is now.

There were some instructions listed recently on the rubyinstaller dev
mailing list on compiling mysql and sqlite I think.  That might help you
:)
Also note you'll need 5.0 not 5.1
GL.
-=r
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 22:55
>
> There were some instructions listed recently on the rubyinstaller dev
> mailing list on compiling mysql and sqlite I think.  That might help you
> :)
> Also note you'll need 5.0 not 5.1
> GL.
> -=r

Can you point me to the rubyinstaller dev list?

I did manage to find one fix:

gem install kwatch-mysql-ruby --platform=mswin32
--source=http://gems.github.com/

It's supposed to be a working mysql gem for 1.9.1.  However, it gives me
the following error:

*** ERROR: can't find mysql client library.
*** extconf.rb failed ***

I also saw that if you use linux you can use mysql 5.1 but with windows
you need to use 5.0 - I'm not sure why this is and not sure how that
will affect me going forward.  All of my websites are hosted and use
mysql 5.1 - they are also on linux/unix boxes.  I just program on a
windows box for convenience.

I appreciate everyone who has helped me out through some of this.  I've
managed to learn a lot today (even with my frustrations) so that's not a
bad thing..
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 23:22
I simplified things for me ..

I went back to 1.8.7 (no more errors)

1.9.1 is just not ready from both a gems usable standpoint and
especially a windows standpoint.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2009-05-29 00:57
> Can you point me to the rubyinstaller dev list?

http://rubyforge.org/mail/?group_id=167

> I did manage to find one fix:
>
> gem install kwatch-mysql-ruby --platform=mswin32
> --source=http://gems.github.com/
>
> It's supposed to be a working mysql gem for 1.9.1.  However, it gives me
> the following error:
>
> *** ERROR: can't find mysql client library.
> *** extconf.rb failed ***

I believe you'll need the mysql headers and libraries installed


> I also saw that if you use linux you can use mysql 5.1 but with windows
> you need to use 5.0 - I'm not sure why this is and not sure how that
> will affect me going forward.  All of my websites are hosted and use
> mysql 5.1 - they are also on linux/unix boxes.  I just program on a
> windows box for convenience.

Yeah I'm not sure why yet--no one's yet looked into it :)
Luis did some good work towards his:
http://github.com/luislavena/mysql-gem/tree/master
however, it's for mingw + 1.8.6

I wasn't able to get mysqlplus to compile for windows yet, either
<sigh>.

Looks like the only way I know of is (assuming ruby 1.9 with devkit)
1) download "mysql 5.0.x windows without installer"
2) unzip, put it in c:\mysql
3) download mysql 2.8.1 binary from tmtm
http://www.tmtm.org/en/mysql/ruby/
4) edit extconf so that anywhere it says mswin32 it now says
mswin32|mingw
 4a) make sure that mysql's bin are *not* in your path
5) run ruby extconf.rb -- --with-mysql-include=c:/mysql/include
--with-mysql-lib=c:/mysql/lib/opt
6) run make, then run make install
7) copy libmysql.dll to your path
8) run ruby -e 'require "mysql"'

if it works you might be one of the first people ever to use it with 1.9
enjoy1
-=r

> I appreciate everyone who has helped me out through some of this.  I've
> managed to learn a lot today (even with my frustrations) so that's not a
> bad thing..

Yeah 1.9 on windows is still pretty cutting edge.  Sharp enough to cut
yourself, most definitely.
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2009-05-29 02:21
(Received via mailing list)
On May 28, 6:22 pm, "J. D." <jdezen...@gmail.com> wrote:
> I simplified things for me ..
>
> I went back to 1.8.7 (no more errors)
>
> 1.9.1 is just not ready from both a gems usable standpoint and
> especially a windows standpoint.
>

I completely understand your frustration.

Is even more frustrating trying to release Ruby installers for 1.8 and
1.9 when it's own set of test fail, stall or crash.

Not so much confidence in the language itself to be able to support
it :-P

I've been working in better-build branch of mysql-gem at GitHub:

http://github.com/luislavena/mysql-gem/tree/better-build

Just one small point: tried to build with 5.1 and failed, so next push
of changes are going to be for MySQL 5.0.

Sorry not been able to help you more, I have on my plate the following
gems:

rake-compiler with fat-binaries (to bundle 1.8 and 1.9 versions of
extensions).

Once that is done, I can move to:

sqlite3-ruby: mostly done, still tests fails on 1.9:

http://pastie.org/486098

mysql-gem is the next in the queue.

Then back to win32console and pretty colors for RSpec and Cucumber,
adding unicode support for 1.9.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 02:28
Thanks to both of you - a lot!

Well, one nice thing is the fact that I can have multiple instances of
Ruby on my machine (which is very helpful).  Not many people can say
with any other language that you just rename 2 folders and everything is
back to working condition, hehe - with ruby you can!

So, I might try doing a few of the suggestions tomorrow (when my brain
unmushes) on the 1.9.1 install folder.  I kept it intact and it has most
of the correct gem updates.  I really want to try and get the mysql
running and if it works on 1.9.1 with what I use then all the better.

Tomorrow is another day - I'll try again.

I finally got down to working with winapi in Ruby today when I was
finishing up my other book.  It was fun to learn some of that stuff with
Ruby.

I still love Ruby and it's ease of use.

Programming is easier than installing! Go figure. :)
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 17:14
I ended up installing VirtualBox and added ubuntu linux to a virtual
drive.  I took my time and researched and managed to compile 1.9.1 from
source on ubuntu with rails and everything is working 100% now.

I'll program with ruby (winapi) on windows and I'll program with Ruby on
Rails on linux.  As I can use both versions now simultaneously due to
virtual box, this solves all of my programming issues.

Thanks folks.

P.S.  I also created a very large topic in the Ruby on Rails forum for
my troubles http://www.ruby-forum.com/topic/188125#new

In this thread towards the bottom, I posted my entire installation
routine for linux in case someone is having similar troubles and happens
to read this thread.

Take care.
E52cf1faea260601ec9b6c42ad50e5c3?d=identicon&s=25 Srinivas P. (srinivas_p)
on 2010-10-15 20:14
Hi Team,

I installed ruby 1.9.2, i am getting follwing error

This application has failed to start because msvcrt-ruby18.dll was not
found. Re-installing the application may fix this problem.

Do you want be to downgrade to 1.9.  thanks for your help.

Regards
Srinivas P
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-10-16 21:15
(Received via mailing list)
On Oct 15, 3:14pm, "Srinivas P." <spavul...@gmail.com> wrote:
> Hi Team,
>
> I installed ruby 1.9.2, i am getting follwing error
>
> This application has failed to start because msvcrt-ruby18.dll was not
> found. Re-installing the application may fix this problem.
>

You're receiving this because the gem that you're trying to use has
been compiled for Ruby 1.8.x and these binaries are not compatible
with Ruby 1.9.x

I would recommend installation of the Development Kit as documented in
RubyInstaller wiki:

http://github.com/oneclick/rubyinstaller/wiki/Deve...

And when find a gem that does not work, for the installation as shown
in the DevKit instructions (gem install xxx --platform=ruby)

Please note that not all gems suffer this problem. The best to do is
contact the gem author and politely ask provide him a gem with
binaries for Ruby 1.9 too.
Ee2809522b2e56d0d6b656486bc5e0db?d=identicon&s=25 Markus Fischer (Guest)
on 2010-10-17 11:05
(Received via mailing list)
Hi Luis,

On 16.10.2010 21:15, Luis Lavena wrote:
> You're receiving this because the gem that you're trying to use has
> been compiled for Ruby 1.8.x and these binaries are not compatible
> with Ruby 1.9.x

I've followed your replies here and also on -core and you seem to be
very knowledgeable about Ruby. One thing I noticed about many (mostly
Windows) related questions from user was that they would happen to mix
different binary Ruby versions; accidentally.

Is there no mechanism for gems to depend on specific Ruby version and
arch-types for binaries (sometimes even sources) ?

thanks,
- Markus
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-10-18 00:51
(Received via mailing list)
On Oct 17, 6:00am, Markus Fischer <mar...@fischer.name> wrote:
> Windows) related questions from user was that they would happen to mix
> different binary Ruby versions; accidentally.
>
> Is there no mechanism for gems to depend on specific Ruby version and
> arch-types for binaries (sometimes even sources) ?
>

I've covered this case back in April 2009 on rubygems-devel list:

http://rubyforge.org/pipermail/rubygems-developers...

You can define a gem to be targeted at one version of Ruby (using gem
spec required_ruby_version attribute), however, you can't generate a
binary gem that target both 1.8.x and 1.9.x series of Ruby.

There are binary differences between 1.8.x and 1.9.x (different C-API,
different VM, etc) that made these pre-compiled extensions
incompatible.

Aaron Patterson came up with a nice idea called fat-binaries -- the
analogy to universal binaries of OSX -- which provides, under the same
gem binaries for both 1.8 and 1.9 versions of Ruby.

You can see examples of that in binary gems like sqlite3-ruby, mysql,
a series of DataMapper (DO) adapters and Nokogiri itself.

The above mentioned libraries rely on rake-compiler as helper to ease
both the binary gems generation and the fat-binary packaging.

But not all gem developers actually know about this and some of them
don't actually care about Windows binaries due it's complexities.

There are some gems that do not depend on external libraries (e.g.
rdiscount, RedCloth, BlueCloth and others) that only needs a compiler
to build its extension.

For those cases you can use RubyInstaller + DevKit and force the
platform during the gem installation:

gem install rdiscount --platform=ruby

That will trigger the compilation process and you're 100% sure, if it
succeed in the compilation, that the binaries are going to work with
your current version of Ruby.

You can read instructions on installation of these elements in our
wiki:

http://github.com/oneclick/rubyinstaller/wiki/Deve...

For the cases that depend on external libraries (mysql, sqlite3-ruby)
you will need to have available the same requirements for a Unix
system: headers and linking libraries available.

That means sometimes just indicate options during the gem
installation:

gem install mysql -- --with-mysql-include=C:/MySQL/include --with-
mysql-lib=C:/MySQL/lib/opt

And others steps required are more depending on the complexity of the
library you're installing.

But, is always better to politely ask the gem author to look into
these issues and also advise him to reach out RubyInstaller group for
assistance in providing these fat-binary gems.
This topic is locked and can not be replied to.