我已经在这里搜索了很多,以确保之前没有问过这个问题。虽然有过多的类似案件,但我找不到其他人遇到我的情况。
我的情况是Rails / Bundler无法找到对我新安装的Gems的任何引用。在这种情况下,Nokogiri。
这是我在尝试运行bundle install
Could not find gem 'nokogori (>= 0) ruby' in the gems available on this machine.
这是OS X优胜美地的全新安装,所以我认为某个核心步骤可能在某处错过了?
我使用过Thoughtbots"笔记本电脑"脚本安装我的所有开发人员的东西,因为与我常用的工具有很多重叠,加上之后安装的Rails。
https://github.com/thoughtbot/laptop
以下是我为重现错误而采取的步骤
安装Nokogiri
Lukes-MBP% gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.6.6.2
Parsing documentation for nokogiri-1.6.6.2
Done installing documentation for nokogiri after 2 seconds
1 gem installed
添加到Gemfile
gem 'nokogori'
确保已安装
Lukes-MBP% whereis nokogiri
/usr/bin/nokogiri
这是我的gem environment
输出
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-darwin14]
- INSTALLATION DIRECTORY: /Users/lukerollans/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: /Users/lukerollans/.rbenv/versions/2.2.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/lukerollans/.rbenv/versions/2.2.0/bin
- SPEC CACHE DIRECTORY: /Users/lukerollans/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/lukerollans/.rbenv/versions/2.2.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-14
- GEM PATHS:
- /Users/lukerollans/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0
- /Users/lukerollans/.gem/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/lukerollans/.rbenv/versions/2.2.0/bin
- /usr/local/Cellar/rbenv/0.4.0/libexec
- /Users/lukerollans/.rbenv/shims
- /usr/local/bin
- /Users/lukerollans/.bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
这一直困扰着我好几个小时,所以如果有人能说清楚我做错了什么,那就太棒了!
答案 0 :(得分:0)
尝试使用
检查您的ruby版本$ rvm list
检查您的ruby版本,然后使用
更改为正确的ruby版本$ rvm use 2.2.0
然后使用
安装nokogiri$ gem install nokogiri