我试图在 XP 上构建 capybara-webkit。我遵循了这个指示。它说要做bundle install
:
$ cd ruby193\capybara-webkit
$ bundle install
此命令安装了许多 gem。不幸的是,我无法构建 capybara-webkit,所以我手动删除了它安装的所有 gem。之后我遇到了问题gem install
-bundle install
这些命令认为已删除的 gem 已安装在我的计算机上,如果它们是我现在要安装的其他一些 gem 的依赖项,则不要安装它们。
请看一个例子。我这样做bundle install
了capybara-webkit
,它说所有的宝石都存在:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\capybara-webkit>bundle install
Resolving dependencies...
Using rake (0.9.2)
Using addressable (2.3.2)
Using bundler (1.3.5)
Using appraisal (0.4.0)
Using mime-types (1.22)
Using nokogiri (1.5.9)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using xpath (2.0.0)
Using capybara (2.1.0)
Using json (1.8.0)
Using capybara-webkit (1.0.0) from source at .
Using ffi (1.2.0)
Using childprocess (0.3.6)
Using diff-lcs (1.1.2)
Using websocket (1.0.6)
Using libwebsocket (0.1.7.1)
Using subexec (0.0.4)
Using mini_magick (3.2.1)
Using multi_json (1.5.0)
Using rack-protection (1.3.2)
Using rspec-core (2.6.4)
Using rspec-expectations (2.6.0)
Using rspec-mocks (2.6.0)
Using rspec (2.6.0)
Using rubyzip (0.9.9)
Using selenium-webdriver (2.27.2)
Using tilt (1.3.3)
Using sinatra (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
但现在我检查这些宝石,bundle show
它说它们都已被删除:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\capybara-webkit>bundle show sinatra
The gem sinatra has been deleted. It was installed at:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sinatra-1.3.5
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\capybara-webkit>bundle show selenium-webdriver
The gem selenium-webdriver has been deleted. It was installed at:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\capybara-webkit>bundle show mini_magick
The gem mini_magick has been deleted. It was installed at:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mini_magick-3.2.1
看起来 Rubygems 不知何故记得 gem 已安装并认为它们仍然存在。似乎只能通过gem uninstall
命令而不是手动删除 gem。
有没有办法清除 Rubygems 缓存?如何通知 Rubygems 一些 gem 已被手动删除,因此它现在应该将它们视为已卸载?