Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting undefined method 'unpack' for nil:NilClass on ruby 2.2 #781

Closed
myronmarston opened this issue Dec 11, 2014 · 15 comments
Closed

Getting undefined method 'unpack' for nil:NilClass on ruby 2.2 #781

myronmarston opened this issue Dec 11, 2014 · 15 comments

Comments

@myronmarston
Copy link

Ruby 2.2-preview2 was released a couple weeks ago and I decided to add it to RSpec's travis build matrix to make sure we're all green on it (and, if not, to provide feedback to the ruby core team about any regressions we find). However, I'm running into an exception from cucumber when travis runs our cukes on ruby-2.2-preview2. (Actually, after looking at the full build logs, it looks like it's using 2.2-preview1...I guess 2.2 in .travis.yml doesn't yet run preview2).

Here's an example of the failure:

https://travis-ci.org/rspec/rspec-expectations/jobs/43763060#L155

Here's the full stack trace:

undefined method `unpack' for nil:NilClass (NoMethodError)
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/step.rb:81:in `text_length'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/step_collection.rb:62:in `block in max_line_length'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/step_collection.rb:62:in `map'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/step_collection.rb:62:in `max_line_length'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/has_steps.rb:53:in `max_line_length'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/has_steps.rb:49:in `source_indent'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/background.rb:40:in `accept'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:64:in `block in visit_background'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:63:in `visit_background'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/feature.rb:36:in `accept'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:27:in `block in visit_feature'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:26:in `visit_feature'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/features.rb:28:in `block in accept'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/features.rb:17:in `each'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/features.rb:17:in `each'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/features.rb:27:in `accept'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:21:in `block in visit_features'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/ast/tree_walker.rb:20:in `visit_features'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/runtime.rb:49:in `run!'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/lib/cucumber/cli/main.rb:47:in `execute!'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/cucumber-1.3.17/bin/cucumber:13:in `<top (required)>'
bin/cucumber:12:in `load'
bin/cucumber:12:in `<main>'

This might be a regression in ruby rather than a bug in cucumber, but I'm not in a good position to figure that out so I figured I'd report it here and let the cucumber team work that out :).

@mattwynne
Copy link
Member

@tooky can you take this one?

@mattwynne mattwynne added this to the 2.1 milestone Dec 22, 2014
@tricknotes
Copy link
Contributor

Probably this will fixed by cucumber/common@09d1b48 that introduced by #774

@coreyhaines
Copy link
Contributor

Just brought down Ruby 2.2 and am getting this with cucumber version 1.3.17.

Any news on when an updated gem will be pushed for the 1.3.x path? I suppose I could update to to the 2.0 betas, if that is what will need to be done.

@davidbegin
Copy link

I was getting this error also with ruby 2.2 and cucumber 1.3.17, but using the v1.3.x-bugfix branch, solved it.

@mvz mvz mentioned this issue Dec 26, 2014
4 tasks
@mattwynne
Copy link
Member

I just released 1.3.18 which has @tricknotes Ruby 2.2 support PR in it, so hopefully a quick bundle update cucumber should fix this for you all.

Happy Christmas!=

@myronmarston
Copy link
Author

Thanks for the quick fix @mattwynne and @tricknotes!

Sent from my iPhone

On Dec 26, 2014, at 3:56 PM, Matt Wynne notifications@github.com wrote:

I just released 1.3.18 which has @tricknotes Ruby 2.2 support PR in it, so hopefully a quick bundle update cucumber should fix this for you all.

Happy Christmas!=

Reply to this email directly or view it on GitHub.

@volmer
Copy link

volmer commented Dec 27, 2014

Thank you guys! 👏

@davidbegin
Copy link

👍 Thank you!

@coreyhaines
Copy link
Contributor

Great job!!! Thanks!

@kritiagg
Copy link

Is there a workaround to get it working in cucumber 1.3.15 as I have dependency on this version?

@aslakhellesoy
Copy link
Contributor

@kritiagg have you tried running with 1.3.18 or 2.0.0?

@kritiagg
Copy link

I cant move to that version as one of the other gem is dependent on the version 1.3.15

@brasmusson
Copy link
Contributor

@kritiagg Is the "one of the other gems" that is dependent on the version 1.3.15, the "Cucumber JSON Expanded formatter" (https://gist.github.com/blt04/9866357)? In that case you can upgrade to version 2.0 or 1.3.17-18, which include #700.

@kritiagg
Copy link

no, I am using gauntlt version 1.0.10

matjack1 added a commit to matjack1/tracks that referenced this issue Oct 5, 2015
TheDoubleK added a commit to Crown-Commercial-Service/digitalmarketplace-functional-tests that referenced this issue Oct 30, 2015
Version 1.3.10 has problems running with Ruby 2.2.3 - `undefined method `unpack' for nil:NilClass (NoMethodError)`
Updating the cucumber version fixes this error.

See: cucumber/cucumber-ruby#781
mukeshtiwari1987 added a commit to mukeshtiwari1987/cucumber-ruby-browserstack that referenced this issue Jul 25, 2018
…rsion cucumber with message '/usr/local/lib/ruby/gems/2.5.0/gems/cucumber-1.3.4/lib/cucumber/ast/step.rb:80: warning: circular argument reference - name'. Updating cucumber version as per suggestions here cucumber/cucumber-ruby#781 (comment)
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants