运行需要包旧版本的程序

时间:2012-06-30 16:50:02

标签: ruby gem

我想运行带有oauth演示的程序,该程序会出现此错误:

/Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/spec_set.rb:88:in `materialize': Could not find crack-0.1.8 in any of the sources (Bundler::GemNotFound)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/spec_set.rb:82:in `map!'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/spec_set.rb:82:in `materialize'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:152:in `specs_for'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/definition.rb:141:in `requested_specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/environment.rb:23:in `requested_specs'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler/runtime.rb:11:in `setup'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.22/lib/bundler.rb:110:in `setup'
from example.rb:2

我发现它需要破解-0.1.8。当我运行gem list时,我发现计算机中的破解版本是0.3.1,那么我该如何解决这个问题呢? (新版本与旧版本不兼容?我很困惑。)

3 个答案:

答案 0 :(得分:0)

只需在Gemfile

中指定此gem的版本即可
gem crack, '0.1.8'

答案 1 :(得分:0)

运行bundle install,它将安装Gemfile中指定的所有Gems的正确版本。它应该在那之后运行。

答案 2 :(得分:0)

Crack 0.1.8可在rubygems.org上找到:

gem install crack -v 0.1.8

应该可以安装所需的版本。