昨天在使用 bundle 的时候 使用了命令:bundle clean --force
只见输出:
Remove Gem activerecord
Remove Gem xxx
Remove Gem xxx
Remove Gem xxx
Remove Gem xxx
Remove Gem xxx
果断ctrl + c
程序结束后。回到项目中 rake -T
输出:
lioooo:deploy lioooo$ rake -T
rake aborted!
cannot load such file -- active_record/deprecated_finders
查看 Gemfile 依赖的 gem 包:
source "http://ruby.taobao.org"
gem "colored", "1.2"
gem "activerecord", "3.2.3"
gem "logging", "1.8.1"
gem "pry", "0.9.10"
gem "capistrano", "2.9.0"
gem "capistrano_colors", "0.5.5"
gem "capistrano-ext", "1.2.1"
gem "rake-hooks", "1.2.3" #rake callback gems
再次回到项目根目录执行命令:bundle install
输出:
Using rake (10.0.3)
Using i18n (0.6.4)
Using multi_json (1.7.2)
Using activesupport (3.2.3)
Using builder (3.0.4)
Using activemodel (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.3)
Using highline (1.6.15)
Using net-ssh (2.6.3)
Using net-scp (1.0.4)
Using net-sftp (2.0.5)
Using net-ssh-gateway (1.1.0)
Using capistrano (2.9.0)
Using capistrano-ext (1.2.1)
Using capistrano_colors (0.5.5)
Using coderay (1.0.9)
Using colored (1.2)
Using little-plugger (1.1.3)
Using logging (1.8.1)
Using method_source (0.8.1)
Using slop (3.3.3)
Using pry (0.9.10)
Using rake-hooks (1.2.3)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
结束后执行命令 rake -T
输出:
lioooo:deploy lioooo$ rake -T
rake aborted!
cannot load such file -- active_record/deprecated_finders
同样的错误 !!!!!!!!!
执行命令 bundle show activerecord
输出
The gem activerecord has been deleted. It was installed at:
/usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3
提示 activerecord-3.2.3
已经被删除。果然 gem list activerecord
结果输出:
gem list activerecord
*** LOCAL GEMS ***
activerecord (4.0.2, 3.2.16, 3.2.14, 3.2.11, 3.2.8, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.0.10, 2.3.11, 2.3.8)
于是奇怪的问题就出现了:bundle
提示 activerecord-3.2.3
已经被删除,但是gem list
却能找到该版本的activerecord
难道 gem list 有什么缓存信息?gem list 是列举出系统 gem env 目录中所有安装的 gem.
这个时候我需要做什么来挽救当前环境呢?