在Windows Server上构建Ruby堆栈:msvcrt-ruby18.dll

时间:2012-02-15 14:05:30

标签: ruby-on-rails ruby json mongrel

我正在尝试运行mongrel_rails,但我得到以下内容:

    the program can't start because msvcrt-ruby18.dll is missing from your computer

Ruby然后给了我以下内容:

    C:\Users\Administrator>mongrel_rails
    C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 126: The s
    pecified module could not be found.   - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mong
    rel-1.1.5-x86-mingw32/lib/http11.so (LoadError)
            from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
            from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mingw32/lib/m
    ongrel.rb:12:in `<top (required)>'
            from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
            from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require
    '
            from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mingw32/bin/m
    ongrel_rails:11:in `<top (required)>'
            from C:/Ruby193/bin/mongrel_rails:19:in `load'
            from C:/Ruby193/bin/mongrel_rails:19:in `<main>'

我试图卸载json并重新安装--version = ruby​​无济于事。我也尝试过使用mongrel --pre,这导致了一组不同的错误:

    NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be remove
    d on or after 2011-11-01.
    Gem::SourceIndex#each called from C:/Ruby193/lib/ruby/gems/1.9.1/gems/gem_plugin
    -0.2.3/lib/gem_plugin.rb:112.
    !!! Path to log file not valid: log/mongrel.log
    mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get hel
    p.

我的堆栈看起来像这样:

    Ruby 1.9.3p0
    Windows Server 2008 R2

    *** LOCAL GEMS ***

    actionmailer (3.2.1)
    actionpack (3.2.1)
    activemodel (3.2.1)
    activerecord (3.2.1)
    activeresource (3.2.1)
    activesupport (3.2.1)
    arel (3.0.0)
    bigdecimal (1.1.0)
    builder (3.0.0)
    bundler (1.0.22)
    cgi_multipart_eof_fix (2.5.0)
    coffee-rails (3.2.2)
    coffee-script (2.2.0)
    coffee-script-source (1.2.0)
    columnize (0.3.6)
    daemons (1.1.8)
    erubis (2.7.0)
    execjs (1.3.0)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    hike (1.2.1)
    i18n (0.6.0)
    io-console (0.3)
    journey (1.0.1)
    jquery-rails (2.0.0)
    json (1.6.5)
    mail (2.4.1)
    mime-types (1.17.2)
    minitest (2.5.1)
    mongrel (1.2.0.pre2 x86-mingw32)
    mongrel_service (0.4.0)
    multi_json (1.0.4)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.1)
    rack-ssl (1.3.2)
    rack-test (0.6.1)
    rails (3.2.1)
    railties (3.2.1)
    rake (0.9.2.2)
    rdiscount (1.6.8)
    rdoc (3.12, 3.9.4)
    sass (3.1.15)
    sass-rails (3.2.4)
    sprockets (2.3.1, 2.1.2)
    sqlite3 (1.3.5 x86-mingw32)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
    tzinfo (0.3.31)
    uglifier (1.2.3)

以前有没有人见过这个?

1 个答案:

答案 0 :(得分:3)

当mongrel二进制文件只适用于Ruby 1.8.x时,似乎你正试图在Ruby 1.9.3上为Mongrel安装二进制宝石

Mongrel尚未更新以使用最新的Ruby或Rails,因此请暂时不要使用它。

您可以使用Thin替代:

gem install eventmachine --pre
gem install thin

预先安装eventmachine预发布版本是必需的,因为最新的稳定版0.12在Windows上不能与Ruby 1.9.x一起使用。

此外,如果您使用的是Windows Server版本,请确保将Ruby可执行文件(ruby.exe)添加到DEP排除列表中:

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