Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fail when version of target gem is not satisfied #37

Closed
mojavelinux opened this issue Dec 7, 2012 · 4 comments
Closed

Fail when version of target gem is not satisfied #37

mojavelinux opened this issue Dec 7, 2012 · 4 comments
Assignees

Comments

@mojavelinux
Copy link

Currently, if the version specified in the Gemfile for the target gem is not installed, then noexec gives up and allows Ruby to select the default version. IMHO, this defeats the whole purpose of using bundle exec. It should fail fast (or make a setting to determine whether it does or not).

To reproduce, install a gem. Then, create a Gemfile that specifies it as a requirement.

gem "sass", "3.1.21"

Then, get it installed.

bundle install

Next, change the version to something different.

gem "sass", "3.1.20"

Finally, run the binary and consult the version.

sass --version

You'll see that it reports "3.1.21" instead of failing to execute.

Turning on debug, you'll see that noexec wasn't happy with what was going on:

$ NOEXEC_DEBUG=1 sass --version
Noexec - starting check
Examining /home/dallen/tmp/foo/Gemfile
Considering "/home/dallen/tmp/foo/.noexec.yaml"
Ignoring candidate /home/dallen/tmp/foo/Gemfile:
Could not find gem 'sass (= 3.1.20) ruby' in the gems available on this machine.
No valid Gemfile found, moving on
Sass 3.1.21 (Brainy Betty)

I think this should be a failure scenario.

@mpapis
Copy link
Member

mpapis commented Dec 7, 2012

ok good point, now consider an example from @wycats gist: https://gist.github.com/85d4c0a9844b11f104cb where you use rake bundler:install which is not the best thing to do, but still might be something you might want to have.

anyway - you would like to have an option to do a warning instead and allow to run it anyway - good idea (options are good).

@mpapis
Copy link
Member

mpapis commented Dec 7, 2012

@mojavelinux could you also consider this request with #36 - maybe they could be mixed ? like fail uless in @global, what do you think about that?

@mpapis
Copy link
Member

mpapis commented Apr 15, 2013

@envygeeks scheduling for 1.2.0.rc1

@mpapis
Copy link
Member

mpapis commented Jul 12, 2013

released as 1.3.0.rc2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants