Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

md5.so/sha1.so loaderror on `gem help command` and `bundler` both error on Win7 64 with 1.9.3-p0, work fine with 1.9.2-p290 #102

Closed
nomoon opened this Issue · 31 comments
@nomoon

I at first thought this might be a problem with rubygems, or with bundler, but the custom_require method seems fine, as I'll show below. I've posted it around

Typing bundle command gives the following error:

C:/Dev/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 193: %1 is not a valid Win32 application.   - C:/Dev/Ruby193/lib/ruby/1.9.1/i386-mingw32/digest/sha1.so (LoadError)
        from C:/Dev/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:1:in `<top (required)>'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:138:in `definition'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
        from C:/Dev/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
        from C:/Dev/Ruby193/bin/bundle:19:in `load'
        from C:/Dev/Ruby193/bin/bundle:19:in `<main>'

I tracked this to the line require "digest/sha1 at the top of bundler-1.0.22/lib/bundler/definition.rb but that looks odd. So I tried something to reproduce the problem.

The following file executes fine:

require "digest/sha1"
puts Digest::SHA1.hexdigest('Test')

but this slight modification throws an error:

require "bundler"
require "digest/sha1"
puts Digest::SHA1.hexdigest('Test')
C:/Dev/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 193: %1 is not a valid Win32 application.   - C:/Dev/Ruby193/lib/ruby/1.9.1/i386-mingw32/digest/sha1.so (LoadError)
        from C:/Dev/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from digesttest.rb:4:in `<main>'

to make matters weirder, this also works fine:

require "rails"
require "bundler"
require "digest/sha1"
puts Digest::SHA1.hexdigest('Test')

However, requiring "bundler" before "rails" causes the same custom_require failure.

To prove this isn't a bundler-only issue, when I run gem help commands I get this error:

ERROR:  Loading command: server (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Dev/Ruby193/lib/ruby/1.9.1/i386-mingw32/digest/md5.so
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::ServerCommand
@luislavena
Owner

Where you obtained RubyInstaller 1.9.3-p0?

Do you have any antivirus software installed? Asking this because extensions provided as part of Ruby are valid applications unless you don't have WoW64 installed (something that is part of Windows x64) or you have DEP enabled.

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-dep_segfault

@nomoon

I downloaded 1.9.3 from the rubyinstaller.org. As noted in the bug, the md5 and sha1 modules will load under most normal circumstances. Something in those gems' code seems to change this, however, though only on this particular version/platform of Ruby. I'm running 1.9.3-p0 with the same gem versions on my Macbook with no problems.

Thanks for the FAQ link. I'm going to try that.

@nomoon

Ok, so I fixed it, but the fix is very weird.

I'm running FRAPS (a framerate and DirectX/openGL screen-recording utility), and whenever it is running, this error is present. As soon as I quit the program, everything is fine.

I can only guess that FRAPS is trolling for some hook that loading these .so files appears to trigger.

@luislavena
Owner

Is normal for those modules to be loaded, what is not normal is you receiving the error of these being invalid win32 application, which can lead to a corrupt installation or something that is blocking the modules from being loaded.

The comparison against OSX is pointless: the operating systems and their layers are completely different so that it worked on OSX does not say anything.

I've Windows 7 x64 Ultimate with Ruby 1.9.3-p0 and works perfectly. I use the same packages as the installer because I built the installers

Please check the Troubleshooting link I provided and also respond to us what AV software you have installed.

If required, please download the 7zip package and:

  • Extract it into a new folder
  • Open a new command prompt
  • Adjust the PATH to it (SET PATH=C:\extrated-ruby193\bin;%PATH%)
  • And try: `ruby -v -e "require 'digest/md5'"

Most likely there is a AV software affecting your machine, DEP protection or there is a DLL conflict that is blocking extension from being loaded.

On your response, please include the current value of PATH (SET PATH) which will help us figure out what is wrong.

Thank you.

@luislavena
Owner

I'm running FRAPS (a framerate and DirectX/openGL screen-recording utility), and whenever it is running, this error is present. As soon as I quit the program, everything is fine.

FRAPS and other tools add hooks that replace normal LoadLibrary behavior and affect loading of extensions.

@luislavena
Owner

Closing this out as being a 3rd party issue.

Please let Bundler guys know about this (and close your report there too).

Thank you.

@luislavena luislavena closed this
@rdp
Collaborator

maybe tell the FRAPS guys too...

@nomoon

Yup. I let them know.

@ZhangBanger

Want to confirm that FRAPS was indeed the issue for me as well (and this was tough to Google!)

@KaiStarkk

Was also the issue for me. Thanks a bunch for the fix, that took a while to find!!

@thegrok

nomoon thank you so much for discovering it's FRAPS, been banging my head against the wall for almost three hours.

@ZhangBanger

Way too many other annoying problems w/windows, so I'm already off of it :). Try fixing the libv8 problems :)

@luislavena
Owner

@ZhangBanger :trollface:

Is not our responsability fix every single gem out there. Is much better use NodeJS externally than using therubyracer and libv8 that eats a lot of memory (and used to segfault).

@ZhangBanger
@luislavena
Owner

Oh, wasn't saying that at all. Actually recommending that people switch to Linux in general.

If you can switch, do it, be happy. Others can't switch for different reasons.

Instead of being helpful you're just alienating people that try to help others by saying that their work is pointless.

Thank you.

@emerencia

I pointed the FRAPS guys to this thread and got the following reply:

   I'm sorry to hear you've experienced this issue and I apologize for the long delay in getting back to you.  Unfortunately we've been unable to reproduce the issue here, and as far as I know these libraries wouldn't be using DirectX or OpenGL so Fraps wouldn't interact with them at all.  About the only thing I could think of is that maybe it's an out of memory issue in the process space.  I don't know how much memory your Ruby installation is using, but Fraps will reserve a bit of memory (around 50meg) in the 32-bit process space in case you start recording, and if your ruby project is using a lot of memory I guess it's possible for an allocation later to fail.  I apologize if this is of no help to you but it's about the only thing I could think of for this situation.

@rdp
Collaborator

yeah, they probably hook into every process though...

@luislavena
Owner

@emerencia @nomoon

I don't think is a problem of memory allocation but more of hooking up process loading.

For example, ANSICON hooks up console writing functions so it can capture ANSI escape codes sent to the console and change the color properly.

I believe FRAPS does the same with other functions, no matter if DirectX or OpenGL is directed.

These tools tend to be a bit aggressive on hooking: they will hook every single library that gets loaded, and sometimes that affects processes.

For example, not long ago ANSICON messed Ruby 1.9.1 IO write and caused things to randomly report issues, specially when dealing with UNICODE.

ANSICON needed to exclude Ruby DLLs to avoid these issues until Ruby was fixed. Something similar happened with ANSICON and an Nvidia driver.

The interaction of tools that hook and patch each-other functions will have undesired results, most likely a crash.

There is nothing we can do about this except document the issue and let people know of possible causes for them to look at.

Feel free to add this to the Troubleshooting page in the wiki:

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting

@KaiStarkk

The FRAPS guys are pretty switched on, I'm glad they looked into it. Luckily enough just not running FRAPS while raking anything solved the problem for me and I don't think I'll ever have the necessity for simultaneity.

@kou5oku

THANK YOU SOO MUCH. Fraps... FRRRRRAAAAAAAAAPPPPPPPSSSS!!!!

that was totally it. hilarious.

Quite interesting that this ONLY affect the subset of humans that are both RORers AND leet enough gamers to fraps crap.

@luislavena
Owner

Added this issue to the Troubleshooting for future references.

@AllegroGavin

FYI, I'm having this same issue with railsinstaller. I do not have FRAPS installed. Things were working then I gem installed green_shoes and things stopped working sometime after that (possibly unrelated).

I have not yet determined what is causing the problem. I uninstalled RailsInstaller (and then deleted the extra 50,000 files in that directory :P) and re-installed it from scratch and I still have the error. The libraries are there in the bin directory of ruby down under RailsInstaller, but they are no longer loading.

Continuing to investigate...

Update: After rebooting things are working again. I tried to get it to fail again (starting up all my usual stuff) without success, so currently unexplained...

@kou5oku
@maryamii

I don't have FRAPS and I have the same problem with the installation. any solution?

@luislavena
Owner

@maryamii most likely you have something installed in your system that is interfering with normal DLL loading.

What AV software you have installed? Have you tried restarting the system in safe mode and attempt to run Ruby?

@maryamii

I think the problem is my anti virus!
I restarted my system in safe mode and it worked!
thanks a lot.

@LeeHounshell

What worked to fix this problem for me:

Edit the file Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
and add the line (just under the top comment block):

require "digest/sha1"

Thanks!

@srsgores

Getting the same error, after updating Ruby to 2.0.0:


PS C:\Users\Sean> gem update
ERROR:  Loading command: update (LoadError)
        193: %1 is not a valid Win32 application.   - C:/ruby200/lib/ruby/2.0.0/x64-mingw32/openssl.so
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
PS C:\Users\Sean>

I do not have FRAPS installed, and my AV is Nod32, which worked with Ruby prior to update.

@luislavena
Owner

@srsgores do you have something like ansicon installed in your prompt?

Recently we had similar issues reported by others to the group:

https://groups.google.com/forum/#!forum/rubyinstaller

There might be other resident software running that could be affecting Ruby.

@srsgores

@luislavena, no I do not have ansicon installed.

@srsgores

Alright, I was able to resolve my issue. I simply uninstalled Ruby, removed all leftovers using revo uninstaller, and then re-installed using rubyinstaller. All is well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.