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

Too old ruby and ruby gems #647

Open
fedorkk opened this issue Nov 8, 2017 · 8 comments
Open

Too old ruby and ruby gems #647

fedorkk opened this issue Nov 8, 2017 · 8 comments

Comments

@fedorkk
Copy link

fedorkk commented Nov 8, 2017

I use zeus 0.15.14 and it requires method_source 0.8.2, at the same time many gems (pry for example) requires method_source >0.9.0. And zeus crashes if used with this gems with exception: can't activate method_source-0.8.2, already activated method_source-0.9.0
Also, zeus uses ruby 2.2.3 which is "nearing its end of life".

@fedorkk fedorkk changed the title To old ruby and ruby gems Too old ruby and ruby gems Nov 8, 2017
@dzajic
Copy link

dzajic commented Jan 3, 2018

I uninstalled method_source 0.9.0, which solved the problem for me.

@ylansegal
Copy link

Very similar issue on my side, but with pry:

You have already activated pry 0.11.3, but your Gemfile requires pry 0.11.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

Uninstalling pry 0.11.3 solves the issue, but seems that it's just a band-aid.

@speckins
Copy link

speckins commented Jul 3, 2018

I've found that adding the gem to the top of custom_plan.rb works, and you don't have to uninstall the offending version.

gem 'method_source', '0.9.0'

require 'zeus/rails'
# ...

(The version you put in custom_plan.rb should be the same version as in your Gemfile.lock.)

@prashant-kajale
Copy link

I tried both workarounds but none is working for me

@nmagedman
Copy link

@speckins’ solution of explicitly requiring the correct version of the conflicted gems is a good one, although it isn't DRY. We can improve upon it by letting Bundler do its job right from the start. My custom_plan.rb starts with:

require 'bundler/setup'
require 'zeus/rails'

@speckins
Copy link

speckins commented Jun 3, 2019

@nmagedman Doesn't that defeat the purpose of keeping 'zeus' out of the Gemfile?

@nmagedman
Copy link

nmagedman commented Jun 3, 2019

@speckins : Sorry, but I don't understand your question. In what sense is zeus "in" or "out" of the Gemfile?

Zeus reads Gemfile.lock and parses out the version number of certain gems. In that sense, it has its hands very dirty with Bundler internals.

Adding an explicit gem line to your custom_plan.rb creates a coupling between zeus and the current state of the Gemfile.lock. We can uncouple them by telling Bundler to handle the Gemfile processing for us.

@speckins
Copy link

speckins commented Jun 5, 2019

The prescribed usage for zeus is not to include it in the Gemfile. From the README:

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.

It's worth noting that you would need to include it in the Gemfile if you use the require 'bundler/setup' line.

@nmagedman I see what you mean in rubygem/lib/zeus/m.rb about zeus grepping the Gemfile.lock and trying to load 'method_source'. I wonder why that doesn't seem to be working. It works for me if I run the same code in irb, say.

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

6 participants