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

Gem::LoadError - terminal-notifier is not part of the bundle #108

Open
mattheworiordan opened this issue Sep 21, 2016 · 1 comment
Open

Comments

@mattheworiordan
Copy link
Contributor

Have started getting this every time I run rerun with Ruby 2.2.5 (didn't have this with 2.2.1 oddly), although I upgraded to the latest bundler was well (which is most likely the issue).

/Users/mattheworiordan/.rvm/gems/ruby-2.2.5@global/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': terminal-notifier is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
        from /Users/mattheworiordan/.rvm/gems/ruby-2.2.5/bin/terminal-notifier:22:in `<main>'
        from /Users/mattheworiordan/.rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
        from /Users/mattheworiordan/.rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'

Checking my local Gem for terminal-notifier, I see I was running terminal-notifier (1.6.2)

Tried updating to the latest version 1.6.3 but that did not make any difference.

Adding this to my Gemfile solves it:

gem "terminal-notifier", require: false

So I am raising this issue only for others really to say:

  • The error is simply bundler telling you that the command you are calling exists, but is not in your bundle. I suspect this has happened after the check for terminal-notifier
    if (cmd = command_named("terminal-notifier"))
    is run.
  • Add it to your Gemfile (which is a bit shit, but works) to get around for it now.

@alexch I think this Gem needs to check if terminal-notififer is in the bundle in a different way to avoid this error, perhaps instead something like if defined?(TeminalNotifier) (pseudo code alert) or maybe Bundler provides a better API for this.

@mattheworiordan
Copy link
Contributor Author

Of course the other option may be to simply remove the gem altogether from your load path as well...

mattheworiordan added a commit to mattheworiordan/rerun that referenced this issue Oct 20, 2016
Fixes issue alexch#108

`which` is used to determine if terminal-notifier can run, but then it’s run inside a Bundler environment where terminal-notifier may not exist in the Gemfile.  This then results in:

/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': terminal-notifier is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
	from /gems/ruby-2.2.5/bin/terminal-notifier:22:in `<main>'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'
mattheworiordan added a commit to mattheworiordan/rerun that referenced this issue Oct 20, 2016
Fixes issue alexch#108

`which` is used to determine if terminal-notifier can run, but then it’s run inside a Bundler environment where terminal-notifier may not exist in the Gemfile.  This then results in:

/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': terminal-notifier is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
	from /gems/ruby-2.2.5/bin/terminal-notifier:22:in `<main>'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
	from /gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'
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