[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Gem update on Windows is broken?

Charles Roper

9/25/2008 8:23:00 AM

When I issue the "gem update" command on Windows, whenever it gets to a
gem whose latest version DOESN'T have Windows binaries, it'll attempt to
build the native extention which will, of course, fail. For example:

Updating sqlite3-ruby
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

The old pre-1.x behaviour of asking for the required platform at least
made updating possible. Now I can't update at all unless I uninstall the
troublesome gems (currently sqlite3-ruby and hpricot), run the update,
then re-install the gems using the --version switch.

Does anyone know of a way to get the update command working again on
Windows or am I stuck?

Many thanks,
Charles
--
Posted via http://www.ruby-....

16 Answers

Eric Hodel

9/25/2008 7:27:00 PM

0

On Sep 25, 2008, at 01:22 AM, Charles Roper wrote:
> When I issue the "gem update" command on Windows, whenever it gets
> to a
> gem whose latest version DOESN'T have Windows binaries, it'll
> attempt to
> build the native extention which will, of course, fail. For example:
>
> Updating sqlite3-ruby
> Building native extensions. This could take a while...
> ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
> ERROR: Failed to build gem native extension.
>
> c:/ruby/bin/ruby.exe extconf.rb update
> checking for fdatasync() in rt.lib... no
> checking for sqlite3.h... no
>
> nmake
> 'nmake' is not recognized as an internal or external command,
> operable program or batch file.

There is no pre-built sqlite3-ruby for any platform.

http://rubyforge.org/frs/?group_id=254&releas...


John T.

9/26/2008 6:09:00 AM

0

Eric Hodel wrote:
> On Sep 25, 2008, at 01:22 AM, Charles Roper wrote:
>>
>> c:/ruby/bin/ruby.exe extconf.rb update
>> checking for fdatasync() in rt.lib... no
>> checking for sqlite3.h... no
>>
>> nmake
>> 'nmake' is not recognized as an internal or external command,
>> operable program or batch file.
>
> There is no pre-built sqlite3-ruby for any platform.
>
> http://rubyforge.org/frs/?group_id=254&releas...

Yes, and has been posted about previously (without any replies), not
having a pre-built sqlite3-ruby causes "gem update" to fail on Windows
systems, preventing other gems to be updated.

Is there a way to tell gem update to either skip that one gem , or
continue updating the rest of the gems?? Until there's a win32 built
version of sqlite3-ruby, this will be causing problems.
--
Posted via http://www.ruby-....

Charles Roper

9/26/2008 6:57:00 AM

0

John T. wrote:
> Eric Hodel wrote:
>> There is no pre-built sqlite3-ruby for any platform.
>>
>> http://rubyforge.org/frs/?group_id=254&releas...
>
> Yes, and has been posted about previously (without any replies), not
> having a pre-built sqlite3-ruby causes "gem update" to fail on Windows
> systems, preventing other gems to be updated.

Yes, this is correct.

Previous versions of sqlite3-ruby had win32 versions (e.g.
sqlite3-ruby-1.2.3-mswin32.gem) and these installed fine. If I issue the
following command, the sqlite3-ruby gem installs just fine:

$ gem install sqlite3-ruby --version 1.2.3
Successfully installed sqlite3-ruby-1.2.3-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.3-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.3-x86-mswin32...

The problem then comes when I run gem update: gems fails to recognise
that the lastest sqlite3-ruby gem does not have a win32 version. It
tries to install the latest, incompatible, version, and fails. The whole
gem update process then stops, thus making a complete update of all gems
impossible.

I should also point out that this issue isn't specific to the
sqlite3-ruby gem; the hpricot gem also triggers this problem.

> Is there a way to tell gem update to either skip that one gem , or
> continue updating the rest of the gems?? Until there's a win32 built
> version of sqlite3-ruby, this will be causing problems.

Yes, I would suggest a few solutions:

* Add some logic to gem update that looks for the platform and tests to
see if the lastest version of a given gem is compatible with that
platform. If it isn't, drop back a version until a compatible version is
found.

* When a gem fails to update, don't kill the whole update; just skip the
gem that wouldn't update.

* Allow for an option to be supplied to gem update that skips supplied
gems. E.g., gem update --skip sqlite3-ruby hpricot

Charles
--
Posted via http://www.ruby-....

John T.

9/26/2008 1:02:00 PM

0

Charles Roper wrote:

> Yes, I would suggest a few solutions:
>
> * Add some logic to gem update that looks for the platform and tests to
> see if the lastest version of a given gem is compatible with that
> platform. If it isn't, drop back a version until a compatible version is
> found.
>
> * When a gem fails to update, don't kill the whole update; just skip the
> gem that wouldn't update.
>
> * Allow for an option to be supplied to gem update that skips supplied
> gems. E.g., gem update --skip sqlite3-ruby hpricot
>
> Charles

Amen. I second this!

Now, eventmachine is killing gem update. I'm getting a compile error.
(Granted this could just be a bug in the eventmachine code, but
still...)

em.cpp
em.cpp(1193) : error C2374: 'i' : redefinition; multiple initialization
em.cpp(1186) : see declaration of 'i'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
--
Posted via http://www.ruby-....

Charles Roper

9/26/2008 2:09:00 PM

0

John T. wrote:

> Now, eventmachine is killing gem update. I'm getting a compile error.
> (Granted this could just be a bug in the eventmachine code, but
> still...)

Same here, although I don't have nmake installed and thus I'm getting
the same old failed to build native extension error:

$ gem update
Updating installed gems
Updating eventmachine
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb update
checking for windows.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=c:/ruby/bin/ruby


Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2 for inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem_make.out
--
Posted via http://www.ruby-....

John T.

9/26/2008 2:18:00 PM

0

Charles Roper wrote:
> John T. wrote:
>
>> Now, eventmachine is killing gem update. I'm getting a compile error.
>> (Granted this could just be a bug in the eventmachine code, but
>> still...)
>
> Same here, although I don't have nmake installed and thus I'm getting
> the same old failed to build native extension error:
>

This machine has installed:

Microsoft Visual Studio 6.0
" Visual Studio 2003
" Visual Studio 2005
" Visual Studio 2008


And no combination of command lines will get the gems to compile, so I
have no idea how to get it to work. (Any version later than 2003 will
bomb with errors about compiler switches that have been deprecated ...
if it's not one thing...)

Thankfully this is just my work Winders box, and most of my real
Rail/Ruby playing is done on OS X :) It just works.
--
Posted via http://www.ruby-....

Roger Pack

9/26/2008 8:23:00 PM

0

> Yes, I would suggest a few solutions:
>
> * Add some logic to gem update that looks for the platform and tests to
> see if the lastest version of a given gem is compatible with that
> platform. If it isn't, drop back a version until a compatible version is
> found.
>
> * When a gem fails to update, don't kill the whole update; just skip the
> gem that wouldn't update.
>
> * Allow for an option to be supplied to gem update that skips supplied
> gems. E.g., gem update --skip sqlite3-ruby hpricot

You could also try mingw ruby:
http://www.akitaonrails.com/2008/7/26/still-playing-with-ruby-...

A little edgey, but hey :)

Cheers.
-=R
--
Posted via http://www.ruby-....

Charles Roper

9/27/2008 9:12:00 AM

0

Roger Pack wrote:
> You could also try mingw ruby:
> http://www.akitaonrails.com/2008/7/26/still-playing-with-ruby-...
>
> A little edgey, but hey :)

Cool, thanks. I had no idea the new mingw version had come so far.
Where's the best place to track progress on it?

Do you think now is the time to switch or does it still feel a little
*too* edgey? If it's usable, but could do with testing help, I'd be more
that happy to help with that effort.

As a side note, it's good to see you're using E Text Editor. Awesome
editor, eh? Did you see the new snippet pipes feature that was recently
rolled in? Here's a post I made about it to the CSS Discuss list with a
bunch of screencasts:

http://archivist.incutio.com/viewlist/css-disc...

Charles
--
Posted via http://www.ruby-....

Roger Pack

9/27/2008 3:02:00 PM

0

> Cool, thanks. I had no idea the new mingw version had come so far.
> Where's the best place to track progress on it?
>
> Do you think now is the time to switch or does it still feel a little
> *too* edgey? If it's usable, but could do with testing help, I'd be more
> that happy to help with that effort.

> As a side note, it's good to see you're using E Text Editor. Awesome
> editor, eh? Did you see the new snippet pipes feature that was recently
> rolled in? Here's a post I made about it to the CSS Discuss list with a
> bunch of screencasts:

Well I can't take much credit--I wasn't actually the blog author :)

The only concern I have with mingw is that some binary extensions aren't
available in a pre-built binary for mingw yet [sqlite, mysql, rmagick]
so you have to install them with --platform=mswin32 which is...a little
unstable. Other than that I'm sure the OCI guys would love some extra
testers and I've used it with success :)

You could track progress on the OCI mailing list and/or at
http://github.com/luislavena/rubyinstaller/t... I believe.

Last I heard they were attempting to bundle it with an updated version
of OpenSSL or what not.

Good luck.
-=R
--
Posted via http://www.ruby-....

brabuhr

9/27/2008 4:29:00 PM

0

On Fri, Sep 26, 2008 at 2:09 AM, John T. <johnts@charter.net> wrote:
> Is there a way to tell gem update to either skip that one gem , or
> continue updating the rest of the gems??

`gem outdated`.split(/\n/).map{|z|z.scan(/^[^[:space:]]+/)}.flatten.map{|z|system("gem
update #{z}")}

;-)