When doing the intial install (or running the reset.bat script), it first gives me the message "No sudo in " and then lists my PATH. Then ig goes through the gems, gets to “installing json 1.8.1” and then I get a pop up from as.exe saying “The procedure entry point libiconv_set_relocation_prefix could not be located in the dynamic link library libiconv-2.dll”
I noted that the PATH statement contains proper entries for Dradis, the Devkit, and my ruby install directory (which I added manually)
Ideas?
etd
April 21, 2014, 9:18am
2
I must confess it’s been a little while since I played with Dradis on Windows.
What version of Ruby are you running?
Did you have a look at this one?
opened 02:49AM - 02 Sep 12 UTC
closed 08:10PM - 02 Sep 12 UTC
I'll start off by saying that I'm not sure how widespread this issue is, it may … just be me, but I would guess from the solution that it has the potential to affect a lot of other people trying to install the DevKit so I decided to post an issue here.
## The Problem
In some cases it seems that the gem install process favors a Windows System version of the libiconv-2.dll file instead of the version that comes with the DevKit install. This causes native gems not to build thus voiding the purpose of the DevKit.
## The (Temporary) Solution
Move the delivered version of libiconv-2.dll (C:\Windows\SysWOW64\libiconv-2.dll) out of the way during native gem installs.
## Background and Troubleshooting
I followed the instructions (https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) and installed the DevKit, but when it came time to test the DevKit by installing the rdiscount gem I would repeatedly get the following error:
```
C:\Users\user>gem install rdiscount --platform=ruby
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for random()... *** 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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby192/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
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.
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.8 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.8/ext/gem_make.out
```
After looking around online I came to the conclusion that most people encounter this error when they either:
- Didn't have the DevKit installed
- Had a space in the path to DevKit
- Installed the wrong version of DevKit for their Ruby version
Since none of these were my problem, I kept trying other things. Eventually I tried running the gem install command in command prompt instead of PowerShell which resulted in a Windows popup directly before the aforementioned error:
```
as.exe - Entry Point Not Found
The procedure entry point libiconv_set_relocation_prefix could not be
located in the dynamic link library libiconv-2.dll
```
This caused me to start searching around for other versions of libiconv-2.dll (a DDL file that is delivered in both C:\DevKit\mingw\bin and in C:\DevKit\mingw\libexec\gcc\mingw32\4.5.2 by the DevKit installer) on my system which I eventually found in C:\Windows\SysWOW64.
After renaming the libiconv-2.dll file in C:\Windows\SysWOW64 the gem install of rdiscount worked perfectly. However, renaming this dll permanently isn't a viable solution long-term since I'm sure that the Windows system needs that DLL for other things.
So I'm guessing that this worked because in an ideal situation the DevKit's version of libiconv-2.dll should override the version that Windows provides during a native gem install? I tried moving DevKit's version to the very front of my system path, but this didn't seem to work for me.
One thing I would recommend is to avoid ruby 2.0 on windows and probably the x64 build (so stick with 1.9.3 and 32-bit) there’s several gems (nokogiri, redcloth) which have problems on 2.0/x64 and are tricky or impossible to work around…
That did it! I renamed the dll in my system32 directory and all installed and compiled perfectly.
Thanks for the help