【问题标题】:Building a Ruby stack on Windows Server: msvcrt-ruby18.dll在 Windows Server 上构建 Ruby 堆栈:msvcrt-ruby18.dll
【发布时间】:2012-03-06 21:09:44
【问题描述】:

我正在尝试运行 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)

有没有人遇到过这种情况?

【问题讨论】:

    标签: ruby-on-rails ruby json mongrel


    【解决方案1】:

    当 mongrel 二进制文件仅适用于 Ruby 1.8.x 时,您似乎正在尝试在 Ruby 1.9.3 上为 Mongrel 安装二进制 gems

    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

    【讨论】:

    • 非常感谢 Luis,这很有帮助。我去瘦身!
    猜你喜欢
    • 1970-01-01
    • 2011-01-11
    • 1970-01-01
    • 2011-06-09
    • 1970-01-01
    • 1970-01-01
    • 2011-04-17
    • 2011-02-19
    • 1970-01-01
    相关资源
    最近更新 更多