Ошибка с автотестом в ruby ​​on rails

Я запустил автотест команды, и это ошибка, которую я получил. Я следую книге Хартла и задаюсь вопросом, происходит ли это столкновение из-за того, что рельсы теперь поставляются с ZenTest или что-то еще? Как я могу обойти эту ошибку. я новичок в ру

Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
/Users//.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find ZenTest (>= 0) amongst [abstract-1.0.0, actionmailer-3.2.8, actionmailer-3.2.8.rc1, actionmailer-3.0.1, actionmailer-3.0.0, actionpack-3.2.8, actionpack-3.2.8.rc1, actionpack-3.0.1, actionpack-3.0.0, activemodel-3.2.8, activemodel-3.2.8.rc1, activemodel-3.0.1, activemodel-3.0.0, activerecord-3.2.8, activerecord-3.2.8.rc1, activerecord-3.0.1, activerecord-3.0.0, activeresource-3.2.8, activeresource-3.2.8.rc1, activeresource-3.0.1, activeresource-3.0.0, activesupport-3.2.8, activesupport-3.2.8.rc1, activesupport-3.0.1, activesupport-3.0.0, addressable-2.3.2, arel-3.0.2, arel-1.0.1, autotest-4.4.6, builder-3.0.4, builder-3.0.3, builder-2.1.2, bundler-1.2.1, bundler-1.2.0, bundler-1.0.22, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.4.0, coffee-script-source-1.3.3, diff-lcs-1.1.3, erubis-2.7.0, erubis-2.6.6, excon-0.16.2, execjs-1.4.0, heroku-2.31.2, heroku-api-0.3.5, hike-1.2.1, i18n-0.6.1, i18n-0.4.2, journey-1.0.4, jquery-rails-2.1.4, jquery-rails-2.1.2, json-1.7.5, launchy-2.1.2, mail-2.4.4, mail-2.2.19, mime-types-1.19, multi_json-1.4.0, multi_json-1.3.6, netrc-0.7.7, polyglot-0.3.3, rack-1.4.1, rack-1.2.5, rack-cache-1.2, rack-mount-0.6.14, rack-ssl-1.3.2, rack-test-0.6.2, rack-test-0.6.1, rack-test-0.5.7, rails-3.2.8, rails-3.2.8.rc1, rails-3.0.1, railties-3.2.8, railties-3.2.8.rc1, railties-3.0.1, railties-3.0.0, rake-10.0.2, rake-0.9.2.2, rdoc-3.12, rest-client-1.6.7, rspec-2.12.0, rspec-core-2.12.1, rspec-expectations-2.12.0, rspec-mocks-2.12.0, rspec-rails-2.12.0, rubygems-bundler-1.1.0, rubyzip-0.9.9, rvm-1.11.3.5, sass-3.2.3, sass-3.2.1, sass-rails-3.2.5, sequel-3.20.0, sinatra-1.0, spork-0.9.2, spork-0.9.0, sprockets-2.1.3, sqlite3-1.3.6, taps-0.3.24, thor-0.16.0, thor-0.14.6, tilt-1.3.3, treetop-1.4.12, treetop-1.4.10, tzinfo-0.3.35, tzinfo-0.3.33, uglifier-1.3.0] (Gem::LoadError)
from /Users//.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users//.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /Users//.rvm/gems/ruby-1.9.2-p320@twitclone/bin/autotest:18:in `<main>'
from /Users//.rvm/gems/ruby-1.9.2-p320@twitclone/bin/ruby_noexec_wrapper:14:in `eval'
from /Users//.rvm/gems/ruby-1.9.2-p320@twitclone/bin/ruby_noexec_wrapper:14:in `<main>'

Поэтому после предложенного ответа я попытался сначала удалить Zentest.

-MacBook-Pro:proto1 $ gem uninstall ZenTest-4.8.4
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
INFO:  gem "ZenTest-4.8.4" is not installed

После этого (несмотря на сообщения об ошибках, я установил более раннюю версию)

s-MacBook-Pro:proto1 $ gem install ZenTest --version "=4.8.3"
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Fetching: ZenTest-4.8.3.gem (100%)
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Successfully installed ZenTest-4.8.3
1 gem installed
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Installing ri documentation for ZenTest-4.8.3...
Installing RDoc documentation for ZenTest-4.8.3...

И затем я запускаю автотест с этим обнаружением!

s-MacBook-Pro:proto1 $ autotest
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
loading autotest/rspec2

Новая часть проблемы:

После того, как мне предложили удалить файл gemspec ZenTest, я не могу запустить spork или сервер rails. Я установил ZenTest 4.8.3, но он показывает следующее:

$ spork
Using RSpec
Preloading Rails environment
Could not find ZenTest-4.8.4 in any of the sources
Run `bundle install` to install missing gems.

person thestralFeather7    schedule 25.01.2013    source источник


Ответы (1)


Чтобы использовать команду autotest, вы должны установить гем ZenTest.
Я думаю, что вы установили ZenTest 4.8.4 в своей системе. этот драгоценный камень не работает должным образом.
Поэтому вам необходимо понизить его до 4.8.3. Удалите все файлы, связанные с ZenTest 4.8.4. затем установите 4.8.3 с помощью команды

gem install ZenTest --version "=4.8.3"

Я думаю, это решит вашу проблему.

Ваше здоровье..!

person ѕтƒ    schedule 25.01.2013
comment
пожалуйста, найдите отредактированный вопрос и посмотрите, где я делаю неправильно? - person thestralFeather7; 25.01.2013
comment
У меня возникали проблемы с сообщением о недопустимом .gemspec даже после установки конкретной версии (и установки ее в моем Gemfile на всякий случай). В итоге я пошел по пути, указанному в ошибке, и удалил неверный файл gemspec напрямую, чтобы успокоить его. Ваш будет в /Users/Arjo/.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec - person Peter Mellett; 26.01.2013
comment
Удалите файл gemspec /Users/Arjo/.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec. Полезный комментарий от Питера - person ѕтƒ; 28.01.2013
comment
@ReNjITh.R -привет, большое спасибо, ребята. но как мне удалить конкретный gemspec? из командной строки? Я очень новичок в рубине на рельсах в целом. - person thestralFeather7; 29.01.2013
comment
@ novice7: Я тоже новичок в ROR. что я сделал, так это просто удалил файл gemspec. Вы просто удаляете файл ZenTest-4.8.4.gemspec. - person ѕтƒ; 29.01.2013