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

error when there is a invalid Gemfile in the current directory #41

Closed
mat813 opened this issue Mar 14, 2013 · 12 comments
Closed

error when there is a invalid Gemfile in the current directory #41

mat813 opened this issue Mar 14, 2013 · 12 comments
Assignees
Milestone

Comments

@mat813
Copy link

mat813 commented Mar 14, 2013

Trying to jist a file and I get:

$ jist out
/Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/bundler-1.1.5/lib/bundler/dsl.rb:12:in `evaluate': There was an error in your Gemfile, and Bundler cannot continue. (Bundler::GemfileError)
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/bundler-1.1.5/lib/bundler/definition.rb:18:in `build'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/bundler-1.1.5/lib/bundler.rb:135:in `definition'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/bundler-1.1.5/lib/bundler.rb:123:in `load'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.6/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.6/lib/rubygems-bundler/noexec.rb:60:in `setup'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.6/lib/rubygems-bundler/noexec.rb:75
        from /Users/mat/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
        from /Users/mat/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `require'
        from /Users/mat/.rvm/gems/ruby-1.8.7-p370/bin/ruby_noexec_wrapper:9

Also, jist is not in that Gemfile, if it would ever help :-)

@envygeeks
Copy link
Contributor

I don't know if I would consider this an error, since we do read the Gemfile and we do expect it to be valid so it's perfectly reasonable this happens, is there something else you expected to happen other than the command to run successfully (because we do wrap around bundler it should fail if you ask me) but I'm open to hearing out suggestions and I'm sure @mpapis is too.

@mat813
Copy link
Author

mat813 commented Mar 15, 2013

Well, I don't expect the Gemfile to be read if I don't do bundle exec, or launch a command like rails that will load it up.

@envygeeks
Copy link
Contributor

Doesn't that sort of go against what this gem is meant to do?

@mat813
Copy link
Author

mat813 commented Mar 15, 2013

Well, no, let me rephrase, I don't expect the Gemfile to get in the way when I try to launch a command, in that case, jist is not even in the Gemfile.
I mean, if the Gemfile has a problem, at most, it should emit a warning and continue as if it was not there.

@envygeeks
Copy link
Contributor

IMO that still defeats the purpose of this Gem. If you use Bundler to install something and then we intern build a wrapper around Bundler you cannot expect us or Bundler to avoid your Gemfile, that not only defeats the purpose of our Gem but Bundler itself.

You can however tell rubygems-bundler not to build wrappers around certain gems with exclude (https://github.com/mpapis/rubygems-bundler#noexecyaml) when you bundle install and if you install into the 'system Gempath' it will avoid Bundler at that point (as long as you do not bundle exec jist)

That said, it's also really not us causing the error, it's Bundler.

@mpapis
Copy link
Member

mpapis commented Mar 15, 2013

this is an extra case, rubygems-bundler should not error in this case, if the Gemfile is not usable (Bundler::GemfileError) then the best solution would be to just fallback to the default behavior - not using the Gemfile, we can add an debug message about that, but I do not think a warning would be in place here.

@envygeeks
Copy link
Contributor

I'm still 👎 I would expect this behavior 💨

@mpapis
Copy link
Member

mpapis commented Mar 15, 2013

if the Gemfile is in 1.9 format (hashes) then under ruby 1.8 it will fail

@envygeeks
Copy link
Contributor

@mpapis brings up good points, even though I think you should fix your Gemfile and such, it's not too bad for us to allow it go through and just tell you that there is a problem with your Gemfile. Sort of an annoyance + don't fail type of situation that way you remember to fix it later. We are probably gonna group this up with #37

@mat813
Copy link
Author

mat813 commented Mar 15, 2013

Well, the thing is, this gem is installed by default with RVM, I did not even know it existed or what it did before I got this error yesterday.
I really believe that it should be as transparent as it could, and in that case, and certainly some other, it means not crashing and dropping the Gemfile completely :-)

@mpapis mpapis closed this as completed in 4cf096a Apr 15, 2013
@ghost ghost assigned mpapis Apr 15, 2013
@mpapis mpapis reopened this Apr 15, 2013
@mpapis
Copy link
Member

mpapis commented Apr 15, 2013

will be released as 1.2.0.rc1

@mpapis
Copy link
Member

mpapis commented Apr 25, 2013

released as 1.2.0.rc1

# 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