尝试使用 rspec,但收到 rspec-core 2.2.1 已被激活的错误,但我的 Gemfile 需要 rspec-core 2.1.0 [英] Trying to use rspec, but getting an error that rspec-core 2.2.1 has been activated, but my Gemfile requires rspec-core 2.1.0

查看:19
本文介绍了尝试使用 rspec,但收到 rspec-core 2.2.1 已被激活的错误,但我的 Gemfile 需要 rspec-core 2.1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新了我的宝石.我已经创建了一个示例 Rails 应用程序,并且在我的 Gemfile 中有以下内容:

I've update my gems. I've created a sample Rails app and have the following in my Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'

group :development do
  gem 'rspec-rails'
end

group :test do
  gem 'rspec'
  gem 'webrat', '0.7.1'
end

但是,当我运行rspec spec/"时,我收到以下消息:

However, when I run 'rspec spec/', I get the following message:

/home/jeff/.rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.7/lib/bundler/runtime.rb:27:in `block in setup': 
You have already activated rspec-core 2.2.1, but your Gemfile requires rspec-core 2.1.0. 
Consider using bundle exec. (Gem::LoadError)

推荐答案

尝试使用 bundle update rspecbundle update rspec-rails.您位于根目录中的 Gemfile.lock 文件可能指定了每个 gem 的版本号.

try using bundle update rspec and bundle update rspec-rails. your Gemfile.lock file, located in the root directory, is probably specifying a version number for each gem.

这篇关于尝试使用 rspec,但收到 rspec-core 2.2.1 已被激活的错误,但我的 Gemfile 需要 rspec-core 2.1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆