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

Update Launchy dependency #11

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@blowmage
Collaborator

blowmage commented Mar 3, 2011

There is a conflict with open_gem and turbulence, because open_gem already has an older version of launchy loaded. Bumped the dependency on launchy to resolve as a stopgap.

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 3, 2011

@joliss

This comment has been minimized.

joliss commented Mar 3, 2011

This also breaks things if I just pull 'launchy' without version spec into my Rails app. (I'm not entirely sure why.)

>= 0.3.5 should work just as well, I think -- no need to force an upgrade to 0.4.

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 3, 2011

@joliss What error do you get? Its probably the same error because RubyGems has already loaded launchy ~> 0.3.5 and Rails tries to load the current version which is 0.4.0. This is why @chad mentioned that RubyGem plugins shouldn't have dependencies on other gems.

@joliss

This comment has been minimized.

joliss commented Mar 3, 2011

Yes, it seems so. Here's the full error I'm getting:

$ bundle exec rake
/var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/runtime.rb:31:in `block in setup': You have already activated launchy 0.3.7, but your Gemfile requires launchy 0.4.0. Consider using bundle exec. (Gem::LoadError)
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/spec_set.rb:12:in `block in each'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/spec_set.rb:12:in `each'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/spec_set.rb:12:in `each'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/runtime.rb:17:in `setup'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler.rb:109:in `setup'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/cli.rb:307:in `exec'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /var/lib/gems/1.9.1/gems/bundler-1.1.pre.1/bin/bundle:13:in `<top (required)>'
    from /var/lib/gems/1.9.1/bin/bundle:19:in `load'
    from /var/lib/gems/1.9.1/bin/bundle:19:in `<main>'
@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 3, 2011

@joliss That's frustrating, I'm sure. No way for bundler to get around it because open_gem already has launchy loaded. You could uninstall open_gem and install from my fork. :)

@joliss

This comment has been minimized.

joliss commented Mar 3, 2011

Yeah, that's what I thought. Well, the path of least resistance for me is to specify launchy ~> 0.3.5 in my Gemfile. ^^

@joliss

This comment has been minimized.

joliss commented Mar 11, 2011

How about using >= 0.3.5 instead, by the way? If 0.3.5 and 0.3.7 work fine, there's no need to force >= 0.4, is there?

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 11, 2011

@joliss, it doesn't appear that @adamsanderson is very responsive, so I doubt it really matters that much.

@joliss

This comment has been minimized.

joliss commented Mar 11, 2011

It's only been a week since you opened this -- you should give him some time. ;-) I'm sure he'll get to it eventually.

@joliss

This comment has been minimized.

joliss commented Mar 11, 2011

Another thought: Perhaps open_gem should instead drop its dependency on launchy, and just detect at runtime whether launchy is available.

I have blogged about this problem here: http://opinionated-programmer.com/2011/03/bundler-problem-you-have-already-activated-launchy-0-3-7/

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 15, 2011

@joliss That would certainly be an improvement. Remove the runtime dependency and only require launchy when you call gem open .... That way launchy is not loaded with rubygems. Good compromise. I'll try to find some time this week to update the patch to do this. (Pretty busy with MWRC.)

@rubiety

This comment has been minimized.

rubiety commented Mar 29, 2011

I just opened this issue:
https://github.com/adamsanderson/open_gem/issues#issue/12

The problem isn't having a dependency on launchy; it's requiring launchy in class load context, which effectively means its loaded every time you require rubygems!

This is causing issues with bundler dependency resolution since the "launchy" gem is being required outside the context of bundler.

It should be a simple fix - require the "launchy" gem only when it is needed, at runtime.

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Mar 30, 2011

@rubiety Agreed. I've been meaning to update this pull request to do just that for some time.

@joliss

This comment has been minimized.

joliss commented Jul 18, 2011

@adamsanderson I agree it would be great if we could eliminate the launchy dependency in open_gem. With changes like this in other people's projects, the conflicts are going to get worse, if anything.

@adamsanderson

This comment has been minimized.

Owner

adamsanderson commented Jul 19, 2011

Sorry I haven't been updating open_gem, I have added @blowmage as collaborator.

@blowmage

This comment has been minimized.

Collaborator

blowmage commented Jul 19, 2011

Thanks Adam!

I'll address the open issues later tonight.

@joliss

This comment has been minimized.

joliss commented Jul 21, 2011

clap-clap-clap Thanks Adam! :-)

@brookr

This comment has been minimized.

brookr commented Sep 12, 2011

Just ran into this issue trying to get a Heroku app running. The heroku gem requires launchy on it's own, which conflicts with what open_gem is doing.

Any hope of this getting fixed? For now, I've uninstalled open_gem.

Thanks, guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment