ranmocy/guard-rails

'zeus is not part of the bundle' using rbenv

pablox-cl opened this issue · 9 comments

~/c/r/tarjira git:master ❯❯❯ which zeus
/home/pablo/.rbenv/shims/zeus
~/c/r/tarjira git:master ❯❯❯ rbenv which zeus
/home/pablo/.rbenv/versions/2.1.1/bin/zeus
~/c/r/tarjira git:master ❯❯❯ ag 'zeus' Gemfile.lock   
~/c/r/tarjira git:master ❯❯❯
~/c/r/tarjira git:master ❯❯❯ ag 'zeus' Guardfile
guard 'rails', zeus: true do
~/c/r/tarjira git:master ❯❯❯ guard -P rails
....
/home/pablo/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.0/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem': zeus is not part of the bundle. Add it to Gemfile. (Gem::LoadError)

I am also using rbenv-binstubs, so maybe the issue has to do with that. It basically allows me to run commands without having to prepend them with bundle exec. Though zeus runs fine since it's installed on the "global" install.

In guard-rails, I just run the zeus without bundle exec. So I think this is the problem of zeus not guard-rails. Maybe you have to add gem 'zeus' to your Gemfile.

Of course, I can add it to the Gemfile, but the instructions of zeus recommend clearly against that:

Q: "I should put it in my Gemfile, right?"

A: No. You can, but running bundle exec zeus instead of zeus adds precious seconds to commands that otherwise would be quite a bit faster. Zeus was built to be run from outside of bundler.

So, what happen when you run it outside bundle exec?

You are right.
Zeus is broken now which was not.
I am looking into it.

❯❯❯ guard -P rails
13:22:12 - INFO - Guard is using NotifySend to send notifications.
13:22:12 - INFO - Guard is using TerminalTitle to send notifications.
13:22:12 - INFO - [Guard::Rails] will start the default web server on port 3000 in development.
13:22:12 - INFO - Starting Rails...

/home/pablo/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'zeus' (>= 0) among 123 total gem(s) (Gem::LoadError)
    from /home/pablo/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /home/pablo/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /home/pablo/.rbenv/versions/2.1.1/bin/zeus:22:in `<main>'
13:22:42 - INFO - Rails NOT started, check your log files.

Any idea?

The debug shows:
15:04:44 - DEBUG - Command execution: {"RAILS_ENV"=>nil} sh -c 'cd "/home/pablo/code/rails/pescve" && RUBYOPT='' zeus server -e development --pid "/home/pablo/code/rails/pescve/tmp/pids/development.pid" -p 3000 &'

Only that I can came up is that there's some problem when zeus server it's being executed, again "from inside" the bundle... (gem list shows way less than 123 gems).

Not sure about this.
Try add gem 'zeus', require: false to your Gemfile.

I don't have zeus in my Gemfile, because it's supposed to not be there.

I will look more into it, but I tried this, and it just works.

I got the way to fix it, will publish it soon.

Just fix it in 0.5.3.
Check it out!