Improve errors usability on failed Bundler.setup #856

Closed
josevalim opened this Issue Nov 17, 2010 · 6 comments

Projects

None yet

3 participants

@josevalim

I was going to make Rails use "bundler/setup" instead of calling Bundler.setup manually, but I have noticed two small but important differences.

  1. Rails uses $STDERR to put message;
  2. Rails prints a message "Try running bundle install."

Reference here:

https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/config/boot.rb

Any chance we can change bundler/setup file to act the same way?

@indirect
Member

bundler/setup has pretty different behaviour than boot.rb. Are you sure you want to catch all BundlerErrors instead of just GemNotFound?

@josevalim

Yehuda told me require "bundler/setup" is the recommended way and that we should go for it. :D

So I changed it in one of my apps and got this error:

jose:~/Work/devs_at_work[ree-1.8.7-2010.02][master*]$ rails s
Could not find i18n-0.4.1 in any of the sources

If I was a beginner, I would be completely clueless at this point. So it may be ok to rescue all BundlerErrors, but we may need (and not only for Rails) a slightly better message in cases a Gem is not found. What do you think?

@indirect
Member

I think that's a good idea. :)

@josevalim

Hey Andre, do you want me to provide a patch for this then?

@indirect
Member

if you could provide a patch that would be great :)

@xaviershay
Collaborator

Re-open with patch.

@xaviershay xaviershay closed this Aug 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment