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

[Fix #7979] Add runtime dependency for did_you_mean #7980

Closed
wants to merge 1 commit into from

Conversation

geshwho
Copy link
Contributor

@geshwho geshwho commented May 15, 2020

Replace this text with a summary of the changes in your PR.
The more detailed you are, the better.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@geshwho geshwho force-pushed the bugs/did_you_mean_dependency branch from 6e223a8 to 1d220b3 Compare May 15, 2020 19:13
@bbatsov
Copy link
Collaborator

bbatsov commented May 17, 2020

I don't think that should needed for a gem bundled with Ruby. It also seems that most people didn't run into such an issue. @koic Any idea what might be causing such a problem?

@geshwho
Copy link
Contributor Author

geshwho commented May 17, 2020

@bbatsov, I noticed yesterday that according to the docs out should be included with Ruby 2.3+. Looks like at least one other person came across this in #7979.

Also in my case, I saw this issue in CI not my local machine so I'm trying to gather more information on that environment.

@koic
Copy link
Member

koic commented May 18, 2020

RuboCop Rails had a similar problem, but hasn't got a solution to it yet.
rubocop/rubocop-rails#243

AFAIK, Ruby has enable and disable options for did_you_mean.

% ruby -v
ruby 2.4.10p364 (2020-03-31 revision 67879) [x86_64-darwin17]

% ruby --enable-did-you-mean -e 'DidYouMean'
% ruby --disable-did-you-mean -e 'DidYouMean'
-e:1:in `<main>': uninitialized constant DidYouMean (NameError)

or

% RUBYOPT='--enable-did-you-mean' ruby -e 'DidYouMean'
% RUBYOPT='--disable-did-you-mean' ruby -e 'DidYouMean'
-e:1:in `<main>': uninitialized constant DidYouMean (NameError)

However, I'm not sure about that is affecting the problem... 🤔

@koic
Copy link
Member

koic commented May 18, 2020

I don't think that should needed for a gem bundled with Ruby.

And I agree with this.

@geshwho geshwho closed this May 22, 2020
@bquorning
Copy link
Contributor

I just ran into this issue as well, but like you I haven’t figured out what the underlying problem is.

@koic I didn’t know about the enable/disable option for this feature, but judging from these different error messages it’s not the problem we are looking for:

ruby -e 'puts DidYouMean::SpellChecker'
-e:1:in `<main>': uninitialized constant DidYouMean::SpellChecker (NameError)

RUBYOPT='--disable-did-you-mean' ruby -e 'puts DidYouMean::SpellChecker'
-e:1:in `<main>': uninitialized constant DidYouMean (NameError)

@bquorning
Copy link
Contributor

Sorry. Let’s keep the discussion in #7979 from here on.

@mosaicin
Copy link

rails server
/home/evgruby/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
/home/evgruby/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/bundler/vendor/thor/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
/home/evgruby/.rvm/gems/ruby-2.7.1/gems/thor-1.1.0/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated
Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead.
Traceback (most recent call last):

@koic
Copy link
Member

koic commented Dec 24, 2021

It looks like a Thor error, not a RuboCop error. JFYI, rails/thor#761 for fix to the issue is already open.

@mosaicin
Copy link

thanks a lot.

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

Successfully merging this pull request may close these issues.

None yet

5 participants