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

Error with listen gem unless bundle exec is used #361

Closed
westonganger opened this issue May 9, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@westonganger
Copy link
Contributor

commented May 9, 2019

If you forgot to use bundle exec when calling wagon serve you get this error:

$ wagon serve -v

Your site is served now.
Browse http://0.0.0.0:3333


# Error description:
cannot load such file -- listen

# Backtrace:

	/home/myuser/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/locomotivecms_wagon-3.0.0.rc0/lib/locomotive/wagon/tools/listen.rb:1:in `require'
...snip...

That sent me on a goose chase until I realized I simply needed bundle exec.

Maybe we could check if the listen gem is installed, something like:

###  wagon/lib/locomotive/wagon/tools/listen.rb

begin
  require 'listen'
rescue LoadError => ex
  puts "Cannot find the `listen` gem. Did you forgot to use `bundle exec` when running your wagon command?".

  raise # re-raise current exception
end

What do you think? I would be happy to send a PR if desired.

@did

This comment has been minimized.

Copy link
Member

commented May 13, 2019

hey @westonganger! thanks for the feedback.
I'm looking for a way to get rid of the bundle exec statement because people who don't know ruby and bundle will be lost for sure.
That's not so easy. In the meantime, your suggestion makes totally sense. So go for the PR! :-)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.