簡體   English   中英

Cent OS 4.8和rails 2.3.4上的Rspec錯誤

[英]Rspec error on Cent OS 4.8 and rails 2.3.4

當我使用“ spec xxx.rb”測試某些ruby代碼時,出現此錯誤:

Missing these required gems:
  webrat  ~> 0.4.4

You're running:
  ruby 1.8.7.174 at /usr/local/bin/ruby
  rubygems 1.3.5 at /root/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.

我已經運行了webrat 0.5.3 gem。 這是我的服務器環境:

操作系統:CentOS 4.8 Ruby 1.8.7 i686-linux Rails 2.3.4

和寶石清單: *當地寶石*

actionmailer (2.3.4, 2.3.3, 2.2.2, 2.0.2)
actionpack (2.3.4, 2.3.3, 2.2.2, 2.0.2)
activerecord (2.3.4, 2.3.3, 2.2.2, 2.0.2)
activeresource (2.3.4, 2.3.3, 2.2.2, 2.0.2)
activesupport (2.3.4, 2.3.3, 2.2.2, 2.0.2)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
cucumber (0.3.104)
daemons (1.0.10)
diff-lcs (1.1.2)
fastthread (1.0.7)
gem_plugin (0.2.3)
git (1.2.3, 1.2.2)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
nokogiri (1.3.3)
passenger (2.2.5)
polyglot (0.2.9)
rack (1.0.0)
radiant (0.8.1)
rails (2.3.4, 2.3.3, 2.2.2, 2.0.2)
rake (0.8.7, 0.8.4, 0.8.1)
RedCloth (4.2.2)
rmagick (2.11.1)
rspec (1.2.8)
rspec-rails (1.2.7.1)
sqlite3-ruby (1.2.5)
term-ansicolor (1.0.4)
treetop (1.4.2)
webrat (0.5.3)

有人知道發生了什么嗎?

Webrat的版本可能與您的rspec版本不兼容。 嘗試像這樣安裝該特定版本:

sudo gem install webrat --version "=0.4.4"

男人!! 遇到相同的問題(幸運的是想出了這個!)

您可能正在使用輻射型,並且很有可能您在config / environments / test.rb中說:

config.gem "webrat", :version => "~>0.4.4", :lib => false

刪除version => "~>0.4.4",它開始工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM