Bugs item #29202, was opened at 2011-05-13 17:42
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29202&group_id=126
Category: `gem` commands (other)
Group: None
Status: Closed
Resolution: Rejected
Priority: 3
Submitted By: Mike Bethany (mikbe)
Assigned to: Ryan Davis (zenspider)
Summary: gem build should force standard date format in metadata file
Initial Comment:
**Description:**
When building a gem the date format used on my OS X machines is incompatible
with the date format used on my Ubuntu 10.10 virtual machines.
OS X uses the following format:
date: 2011-05-13 00:00:00.000000000Z
Where as on Ubuntu the date format is:
date: 2011-05-13 00:00:00 Z
**Error message on Ubuntu (but not OS X):**
Invalid gemspec in
[/usr/local/ruby/lib/ruby/gems/1.9.1/specifications/osx_vs_ubuntu-0.0.1.gemspec]:
invalid date format in specification: "2011-05-13 00:00:00.000000000Z"
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:277:in
`block in _resort!': undefined method `name' for nil:NilClass (NoMethodError)
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:276:in
`sort!'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:276:in
`_resort!'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:270:in `_all'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:402:in `each'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in
`find_all'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in
`matching_specs'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in
`to_specs'
from
/usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/ruby/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from /usr/local/ruby/bin/rake:18:in `<main>'
**Steps to replicate:**
Create a gem app:
$ bundler gem osx_vs_ubuntu
$ cd osx_vs_ubuntu
$ git add .
$ git commit -am "initial commit"
Edit gemspec file setting: authors, email, summary, and description.
Build the app on OS X machine:
$ rake build
Copy gem to an Ubuntu machine.
Install gem on Ubuntu machine.
$ gem install osx_vs_ubuntu-0.0.1.gem
Invalid gemspec in
[/usr/local/ruby/lib/ruby/gems/1.9.1/specifications/osx_vs_ubuntu-0.0.1.gemspec]:
invalid date format in specification: "2011-05-13 00:00:00.000000000Z"
ERROR: While executing gem ... (NoMethodError)
undefined method `name' for nil:NilClass
**Work arounds**
* Build the gem on an Ubuntu machine.
* Uncompress the gem file, uncompress the metadata file, edit the metadata file
to use Ubuntu format, recompress metadatafile, recompress gem file.
Hardcoding the date format in the gemspec file to the Ubuntu version does not
help. The date is redone when the gem is built.
----------------------------------------------------------------------
>Comment By: Mike Bethany (mikbe)
Date: 2011-05-18 22:07
Message:
The reason I say Ubuntu is because I'm being specific. I am telling you what
operating
system I'm having the problem with as piece of data not as a indication of the
cause.
I do have YAML installed in Ubuntu:
ii libyaml-0-2 0.1.3-1 Fast YAML 1.1 parser and
emitter library
ii libyaml-dev 0.1.3-1 Fast YAML 1.1 parser and
emitter library
(development)
And finally this was not discussed at length on reddit. This is the entirety of
the time
issue response, "This has nothing to do with ubuntu vs osx and everything to do
with
syck vs psych. You probably have the library you need on ubuntu and not on
osx."
Which was less than helpful.
----------------------------------------------------------------------
Comment By: Ryan Davis (zenspider)
Date: 2011-05-18 20:57
Message:
This is a dupe and has nothing to do with OSX vs Ubuntu. This was discussed
with the OP at length on reddit, but apparently was ignored.
The problem is syck vs psych. Psych will output perfectly good (according to
YAML spec) time strings that Syck can't parse. The problem is the missing space
before the "Z".
I assume that the OP doesn't have libyaml installed on ubuntu, so syck is used
instead of psych.
----------------------------------------------------------------------
Comment By: Mike Bethany (mikbe)
Date: 2011-05-18 19:49
Message:
It doesn't appear to be a Ruby 1.9.2p180 vs p0 issue:
Ubuntu 11.04 (GNU/Linux 2.6.38-8-server x86_64):
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
OS X 10.6.7 (Darwin Kernel Version 10.7.0):
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
----------------------------------------------------------------------
Comment By: Alex Chaffee (alexch)
Date: 2011-05-18 18:59
Message:
Looks like a dup of bug #29181. FWIW it's not Ubuntu vs MacOS, it looks like
it's Ruby 1.9.2p180 vs Ruby 1.9.2p0 (or thereabouts). Can you do a "ruby -v" on
each of your boxes to confirm my hypothesis?
http://rubyforge.org/tracker/index.php?func=detail&aid=29181&group_id=126&atid=575
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29202&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers