-
-
Notifications
You must be signed in to change notification settings - Fork 2k
NoMethodError: undefined method `prelease?' for nil:NilClass #3639
Comments
I just added a version to the Gemspec and that solved the issue. This should probably be checked for. |
Gemspecs aren't valid without versions, so we should probably throw a useful error here. On Mon, May 11, 2015 at 9:22 AM, Kristofer Rye notifications@github.com
|
Exactly my thoughts. I haven't contributed to bundler yet, but I'd be glad to make it throw a useful error and submit that. |
Maybe for non-rubygems deps, we could call |
If I got it right, Gem::Specification::validate only exists for ruby > 1.9. Since we have travis for older versions, I suppose we should keep compatible? If is that so, maybe we should create our own validate method, that takes in account only things that we actually need, like version? |
Or maybe we only validate when the method is available? -Samuel E. Giddins On May 11, 2015, at 5:28 PM, Felipe Tanus notifications@github.com wrote: If I got it right, Gem::Specification::validate only exists for ruby > 1.9. Since we have travis for older versions, I suppose we should keep compatible? If is that so, maybe we should create our own validate method, that takes in account only things that we actually need, like version? — |
I like @fotanus' idea; just check to see if |
@indirect thanks for the guidance. I have been hacking this for some time now, and I don't think I found the correct place to put the test of a missing version. Is this right? |
I can get a message of, but it is always on the eval line instead on the line mentionated on the issue. So maybe my test got other related issue? However, I can reproduce the issue with the correct offending line pointed by the OP by using this:
|
Hi there, yes, it makes sense! Thanks for showing me! However, the spec I wrote still fails because of a nil version:
Is it silly to care about this case or should I try to fix it? |
@fotanus I think it's probably okay to stop here. With commit 654e44a, Bundler produces this output:
when run on a Gemfile containing just
|
👍 |
What did you do?
I ran the command
bundle install
What did you expect to happen?
I expected Bundler to function properly and download and install all packages.
What happened instead?
Instead, I got this error.
Error details
Environment
Some further information:
I've got a Gemspec defined, but there isn't a version in it yet.
The text was updated successfully, but these errors were encountered: