I was attempting to run the Ruby Thin demo application on Windows/XP
when I got an error that Windows couldn't find "msvcr90.dll" for Ruby
1.8.7 -- I found a redistributable and put that in my path to be
confronted with the information that:
"R6034 ... application has made an attempt to lead the C runtime
incorrectly"
Earlier today I ran a few eventmachine demos oK, so I am thinking that
the problem is with Thin.
The Ruby stack dump isn't that helpful ... (included below). Is there
a cure?
* Thin (1.2.2)
* Rack (1.0.0, 0.9.1, 0.4.0, 0.3.0) ......
* EventMachine (0.12.8) .................. eventmachine-0.12.8-x86-
mswin32-60
I've looked over the other MSVCR90.DLL posts here and on
stackoverflow, none of those cures work. The MSVCR90.DLL is now in
system32 -- I still get the "incorrectly linked" error with the: "ruby
adapter.rb" example.
Thanks in advance.
... Will
------
W:\> ruby adapter.rb
>> Thin web server (v1.2.2 codename I Find Your Lack of Sauce
Disturbing)
>> Maximum connections set to 1024
>> Listening on 127.0.0.1:3000, CTRL+C to stop
c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin_parser.so: 1114: A dynamic link library (DLL) initialization
routine failed.
- c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin_parser.so (LoadError)
from c:/bin/ruby/v1.8/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in `require'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin/request.rb:1
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin/connection.rb:35:in `post_init'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/em/connection.rb:43:in `new'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/em/connection.rb:36:in
`instance_eval'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/em/connection.rb:36:in `new'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/eventmachine.rb:1490:in
`event_callback'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/eventmachine.rb:242:in
`run_machine'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/
eventmachine-0.12.8-x86-mswin32-60/lib/eventmachine.rb:242:in `run'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin/backends/base.rb:57:in `start'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin/server.rb:156:in `start!'
from c:/bin/ruby/v1.8/lib/ruby/gems/1.8/gems/thin-1.2.2/lib/
thin/server.rb:142:in `start'
from adapter.rb:21
---------- Forwarded message ----------
From: winston <winston.yong...@gmail.com>
Date: Mar 16 2008, 1:32 am
Subject: Thin on Windows reprise
To: thin-ruby
Thin requires the following dependencies:
1. Rack
2. EventMachine
Unfortunately, eventmachine 0.10.0 is not a win32 release, so it's
difficult to install it onwindows. Instead, download a win32
eventmachine fromhttp://rubyforge.org/frs/download.php/23665/eventmachine-win32-0.8.1.gem
. Even though the version is 0.8.1, however, I have not encountered
any problems so far with this version. Of course, I am only
usingwindowsfor development, and not for production.
I would say most would recommend you to go with eventmachine 0.10.0
(which would only work with *nix systems), for production env, as it's
more stable.
Anyway, follow these steps to installthinonwindows:
1. install rack:
>> gem install rack
2. download eventmachine fromhttp://rubyforge.org/frs/download.php/23665/eventmachine-win32-0.8.1.gem
>> gem install eventmachine -l
3. installthin, but ignore dependencies
>> gem installthin--ignore-dependencies
This should installthinsuccessfully onwindows.
cheers,
Winston
On Mar 15, 11:57 am, Chirag <patel...@gmail.com> wrote:
> Could someone send me tell me how to runThinonWindows? I tried gem
> installthin, but get the below error. I also did gem install
> eventmachine (0.8.1), but still no dice. Will I need to runThinas a
>Windowsservice?
> Thanks, Chirag
> C:\chirag\mindmap\HaloTrac>gem installthin
> Building native extensions. This could take a while...
> ERROR: Error installingthin:
> ERROR: Failed to build gem native extension.
> C:/ruby/bin/ruby.exe extconf.rb installthin
> checking forwindows.h... no
You cannot do that with recent Microsoft runtimes, because they should
not be loaded directly. You should copy a complete package (the
directory containing dlls and manifest) next to your .dll/.exe for
them to load correctly.
> I've looked over the other MSVCR90.DLL posts here and on
> stackoverflow, none of those cures work. The MSVCR90.DLL is now in
> system32 -- I still get the "incorrectly linked" error with the: "ruby
> adapter.rb" example.
You should not copy it to system32 either. The ideal solution is to
actually *install* the vcredist package that you have downloaded,
because the installed runtime should go via Windows' WinSxS system.
Static compiling will not work with languages like Ruby, because then
every extension would have its own copy of C runtime, and memory
wouldn't be safe to allocate/free between them, file handles couldn't
be shared, etc. That's why ruby uses dynamic runtime.
But to be honest with you here, it's actually quite sad that official
Ruby distribution for Windows requires people to use Microsoft Visual
Studio 6.0 to compile extensions. It's pretty expensive and hard to
come by these days, so old it is.
The latest free Visual Studio is however VSExpress 2008, which links
to msvcr90.dll, and which must have been used to compile thin. You
can't expect people to pay lots of money to release something free for
you to use. That's why IMHO it would probably be easier for you to
compile Ruby with VSExpress 2008, or purchase Visual Studio 6.0 and
compile thin yourself.
Well, don't get me wrong, but building with /MT is a bad idea, not
only because of more bloat, more heaps, more initialization, but
because you run a risk of freeing something you didn't allocate, or
let other code free something that you allocated, and so on, and so
forth. Of course ruby tries very hard to minimize the risks, by using
its ruby_xmalloc, ruby_xfree, etc, but still it can happen and lead to
very strange things when you least expect it. You can do whatever you
want with extensions you release, but it is scary when people do
whatever they want, how is one supposed to use it in production?
I myself prefer to compile extensions from source, this way I can be
sure that all extensions are tailored for my environment and that they
are compatible. Although the situation with ruby and compilers didn't
look very good to me. I'm very new to ruby, but even in these days I
could notice that extension authors forget to check for /mingw/ along
with /mswin/, rubygems forgets to check C runtime version when
installing binary extensions (which isn't very good for me when I'm
using msvcr90 and it happily installs msvcrt version for me), always
forcing me to use non-existent --platform source.
Yes, ruby-installer based on mingw is a good thing, because now
extension authors may finally notice that there are platforms on
windows other than /mswin/ or /cygwin/. But until it's official and
pushed from ruby-lang I doubt it would revolutionize everything.
Actually I found that cygwin is a lot better than native windows. You
get full posix capabilities, you can compile everything from source,
you get full access to win32 apis (Win32API, Win32OLE, etc.), you
don't need win32-service (and you can install services that actually
work!), and so on and so forth. For ruby and rails developments cygwin
is more suitable, it has all the benefits (with the latest beta cygwin
you can even transparently work with unicode filenames, something you
can't easily do with ruby on win32!) and almost none of drawbacks.
In final words, I'd suggest please, don't start using /MT or anything
crazier. Binary extensions on windows is enough of a mess already, no
need to kill it even further.
>
> On Jul 21, 7:03 am, will <william.full.m...@gmail.com> wrote:
>> Hi James,
>>
>
> Hello Guys, I love to chime in...
Welcome and thx, <3