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

routes command fails w/ NoMethodError (undefined method `except' for #<Hash #1

Open
jhirbour opened this issue Mar 23, 2023 · 1 comment

Comments

@jhirbour
Copy link

jhirbour commented Mar 23, 2023

ruby version

2.7.2

OS

Mac Intel Running latest ventura 13.2.1

Gemfile

# frozen_string_literal: true
source 'https://rubygems.org'


gem 'sinatra'
# for irb console in the app use the 'rax' command
gem 'sinatra-rax'

gem 'faraday'
# gem 'newrelic_rpm'
gem 'puma'

group :development do
  gem 'awesome_print'
  gem 'byebug'
  gem 'guard', '2.16.2'
  gem 'guard-rspec', '4.7.3', require: false
  gem 'rack-test', '1.1.0'
  gem 'rake', '13.0.3'
  gem 'rerun', '0.13.1'
  gem 'rspec', '3.10.0'
  gem 'rubocop', '1.10.0', require: false
end

Issue

╰ $ bundle exec rax
2.7.2 :001 > routes
Traceback (most recent call last):
        7: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/bin/ruby_executable_hooks:22:in `<main>'
        6: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/bin/ruby_executable_hooks:22:in `eval'
        5: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/bin/rax:23:in `<main>'
        4: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/bin/rax:23:in `load'
        3: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/gems/sinatra-rax-1.0/bin/rax:97:in `<top (required)>'
        2: from (development):1
        1: from /Users/johnhirbour/.rvm/gems/ruby-2.7.2@sinatra_app/gems/sinatra-rax-1.0/bin/rax:78:in `routes'
NoMethodError (undefined method `except' for #<Hash:0x00007fa69ca1bec8>)
2.7.2 :002 >
@jhirbour jhirbour changed the title routes command fails routes command fails w/ NoMethodError (undefined method `except' for #<Hash Mar 23, 2023
@jhirbour
Copy link
Author

Ah except was added in Ruby added except to hashes in Ruby 3.x

https://blog.saeloun.com/2020/09/30/ruby-adds-support-for-hash-except#:~:text=Ruby%20adds%20instance%20method%20%23except,hash%20except%20the%20given%20keys.

Having the min ruby version in the gemspec would have failed better. rubygems/bundler-features#119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant