【问题标题】:Rails Bundler on windows refuses to install hpricot (even on manual gem install get Error: no such file to load -- hpricot)Windows 上的 Rails Bundler 拒绝安装 hpricot(即使在手动 gem install get Error: no such file to load -- hpricot)
【发布时间】:2010-11-11 20:55:07
【问题描述】:

在混合平台开发组中升级到 rails 3,并使用 Bundler for gems。我在 Windows 上。当我运行 Bundle Install 时,它成功完成,但不会安装 hpricot。 hpricot 线是:

gem "hpricot", "0.8.3", :platform => :mswin

也试过

gem "hpricot", :platform => :mswin

两者都很好,但是当我尝试做一个“捆绑显示 hpricot”时,我得到:

Could not find gem 'hpricot' in the current bundle.

如果我运行一个 Rails 控制台并尝试“require 'hpricot'”,我会得到:

LoadError: no such file to load -- hpricot

我也手动安装了 hpricot,但仍然出现上述错误。这在移动到 rails 3 之前运行良好。

【问题讨论】:

    标签: ruby-on-rails windows rubygems bundler hpricot


    【解决方案1】:

    在控制台中试试这个,然后进行捆绑安装,它会起作用:

    gem install hpricot --platform=mswin32
    

    【讨论】:

      【解决方案2】:

      您可能正在使用使用 MinGW 构建的 ruby​​ 版本,在这种情况下,您的平台将是“mingw”而不是“mswin”。尝试将您的 Gemfile 行更改为以下内容:

      gem "hpricot", "0.8.3", :platform => :mingw
      

      如果您有其他开发人员正在使用当前设置并且不想为他们破坏它,请将其更改为:

      gem "hpricot", "0.8.3", :platforms => [:mswin, :mingw]
      

      【讨论】:

        猜你喜欢
        • 2012-06-24
        • 2012-10-07
        • 2023-03-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-25
        • 1970-01-01
        相关资源
        最近更新 更多