ruby - 安装带有 Rails : "Could not find "Nokogiri. 的 Nokogiri Gem 的问题 .."

标签 ruby ruby-on-rails-3 rake nokogiri bundler

Nokogiri 在我的 gem 文件中。 bundle 安装返回预期的输出:

Using nokogiri (1.4.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

尝试执行 db:create:all 时出现以下错误:

rake db:create:all
Could not find nokogiri-1.4.4 in any of the sources

如果我在 irb 中测试,我也会得到预期的输出。

irb(main):003:0> require "rubygems"
=> true
irb(main):004:0> require "nokogiri"
=> true

我已经多次卸载和安装 nokogiri 及其依赖项。

我正在使用:

轨道 3.0.6 ruby 1.8.7

如有任何帮助,我们将不胜感激。

编辑:美国东部时间 2011 年 4 月 25 日下午 3:02

对于下面的评论:nokogiri 的 Gemfile 行是

gem "nokogiri", '1.4.4', :require => "nokogiri"

最佳答案

我根据你的情况进行了测试。
我的 Gemfile 是这样的:

gem "nokogiri", '1.4.4', :require => "nokogiri"

然后 rake db:migrate 工作得很好

关于ruby - 安装带有 Rails : "Could not find "Nokogiri. 的 Nokogiri Gem 的问题 ..",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5781858/

相关文章:

arrays - 为什么我不能在 ruby​​ 中的数组上使用 Match 方法?

ruby-on-rails - Ruby:比较 2 个数组的匹配项,并计算匹配实例的数量

ruby-on-rails - 即使安装了 libv8,Gem therubyracer 也不会安装

ruby-on-rails - rails c 抛出错误 bin_path':找不到 rails-3.2.8 的可执行 rails(Gem::Exception)

ruby-on-rails - 在 Ruby on Rails 中,render 'shared/score' , :locals => { :score => @foo. score } 会不会在本地通过?

javascript - Rails 3 使用 Jquery 远程提交单选按钮表单(不使用 $.post)?

ruby-on-rails - 为什么我在 bundle exec 中执行环境后 rake 中止

ruby-on-rails - 这是通过 Controller 进行质量分配的安全方法吗?

ruby-on-rails - Ruby on Rails - 使用 md5 的 Postgresql - Rake 中止! fe_sendauth : no password supplied

ruby-on-rails - 在 Rails 中 rake cucumber 而不删除数据库