GlinesMome
GlinesMome

Reputation: 1629

Cucumber, RVM, Ruby 2.0.0 and 1_8_7 constant Error

I have done a simple $ gem install cucumber on RVM with Ruby 2.0.0 (on FreeBSD 9.1-i386 GENERIC), and, when I run $ cucumber I have the following error:

uninitialized constant Cucumber::RUBY_1_8_7 (NameError)
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/constantize.rb:36:in `constantize_name'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/constantize.rb:12:in `block in constantize'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/constantize.rb:11:in `each'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/constantize.rb:11:in `constantize'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:73:in `load_programming_language'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:194:in `programming_language_for'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:178:in `load_file'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime.rb:183:in `load_step_definitions'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/runtime.rb:42:in `run!'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/cli/main.rb:47:in `execute!'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/bin/cucumber:13:in `<top (required)>'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/bin/cucumber:23:in `load'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/bin/cucumber:23:in `<main>'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/bin/ruby_noexec_wrapper:14:in `eval'
/home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/bin/ruby_noexec_wrapper:14:in `<main>'

Have you got a simillar issue?

Thanks by advance for your help.

PS : my gems list is:

bigdecimal (1.2.0)
builder (3.2.2)
bundler (1.3.5)
cucumber (1.3.2)
diff-lcs (1.2.4)
gherkin (2.12.0)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
multi_json (1.7.7)
psych (2.0.0)
rake (10.0.4, 0.9.6)
rdoc (4.0.0)
rubygems-bundler (1.1.1)
rvm (1.11.3.7)
test-unit (2.0.0.0)

Upvotes: 1

Views: 705

Answers (2)

mpapis
mpapis

Reputation: 53158

The code that breaks was removed in master, try:

bundle init # create a Gemfile
echo "gem 'cucumber', :git => 'https://github.com/cucumber/cucumber.git'"
bundle install
bundle exec cucumber

if you want to use any extra gems this way, you need to put them into Gemfile you can read more about it and bundler visit it's site: http://gembundler.com

Upvotes: 1

mpapis
mpapis

Reputation: 53158

looks like a bug in Cucumber version 1.3.2, it should be relatively to fix.

  1. Find cucumber/constantize:

    gem which cucumber/constantize
    

    in your case it should be:

    /home/black/.rvm/gems/ruby-2.0.0-p0@cucumber/gems/cucumber-1.3.2/lib/cucumber/constantize.rb
    
  2. Edit this file and add this text on the beginning:

    require 'cucumber/platform'
    

Upvotes: 0

Related Questions