Reputation: 43
My enviorenment:
**Rails - 2.3.14
Ruby - ree/ruby 1.8.7**
I am trying to use cucumber for the first time. I followed => http://railscasts.com/episodes/155-beginning-with-cucumber for my existing project.
I have executed the **bold** commnads but it is giving the below mentioned error though I have rspec-core,rack-test & i18n latest version in my system:
==============================================================================
**rvmsudo rake gems:unpack RAILS_ENV=test**
[sudo] password for ilfs:
(in /home/ilfs/work/ces)
Please install RDoc 2.4.2+ to generate documentation.
DEPRECATION WARNING: Rake tasks in vendor/plugins/TBD_ prawnto/tasks, vendor/plugins/jrails/tasks, and vendor/plugins/online_help/tasks are deprecated. Use lib/tasks instead. (called from /home/ilfs/.rvm/gems/ree-1.8.7-2012.02@ces/gems/rails-2.3.14/lib/tasks/rails.rb:10)
gem install rspec --version ">= 1.2.2"
ERROR: Error installing rspec:
rspec requires rspec-core (~> 2.11.0)
gem install rspec-rails --version ">= 1.2.2"
ERROR: Error installing rspec-rails:
activesupport requires i18n (~> 0.6)
gem install webrat --version ">= 0.4.3"
ERROR: Error installing webrat:
webrat requires rack-test (>= 0.5.3)
rake aborted!
undefined method `version' for nil:NilClass
(See full trace by running task with --trace)
============================================================================
ilfs@ilfs:~/work/ces$ **rvmsudo rake gems:unpack:dependencies RAILS_ENV=test**
(in /home/ilfs/work/ces)
Please install RDoc 2.4.2+ to generate documentation.
DEPRECATION WARNING: Rake tasks in vendor/plugins/TBD_ prawnto/tasks, vendor/plugins/jrails/tasks, and vendor/plugins/online_help/tasks are deprecated. Use lib/tasks instead. (called from /home/ilfs/.rvm/gems/ree-1.8.7-2012.02@ces/gems/rails-2.3.14/lib/tasks/rails.rb:10)
gem install rspec --version ">= 1.2.2"
ERROR: Error installing rspec:
rspec requires rspec-core (~> 2.11.0)
gem install rspec-rails --version ">= 1.2.2"
ERROR: Error installing rspec-rails:
activesupport requires i18n (~> 0.6)
gem install webrat --version ">= 0.4.3"
ERROR: Error installing webrat:
webrat requires rack-test (>= 0.5.3)
rake aborted!
undefined method `version' for nil:NilClass
(See full trace by running task with --trace)
==================================================================================
This is first time I am trying to use cucumber, have no idea about it except rails cast video's concept. As I my system does not yet configured so I am not able to test anything.
Expecting help -
Thanks in advance
Sumanta
Upvotes: 0
Views: 658
Reputation: 43
I solved this issue - at first I was adding gems in enviorement/tests.rb but after adding those gems in gemfile - problem get solved. this is the step-
in gemfile
group :development, :test do
#gem "rspec-rails", '>=1.3.2'
gem 'rspec', '>=1.3.2'
gem "capybara", "0.3.9"
gem "cucumber", ">=0.2.2"
gem "cucumber-rails", "0.3.2"
gem 'database_cleaner'
gem 'webrat', ">=0.4.3"
end
from project folder console/terminal run this command => ruby script/generate cucumber
Upvotes: 1
Reputation: 2274
At a glance I would say that your are having dependency issues. Rails 2 is pretty old, and those gems you are trying to install have moved quite far ahead of where Rails 2 is.
So I would avoid using the ">=" specification in the Gem requirement. Since you're using a Railscasts as a learning tool, I would make the Gem versions "=". So you can at least guarantee that the versions are the same.
Using ">=" for legacy project is pretty dangerous as Ruby gems are fast moving targets. So for every legacy app, there comes a day when you have to lock versions.
Upvotes: 0