[Rubygems-developers] Specifying a platform
gsinclair at soyabean.com.au
Sat Apr 17 17:30:07 EDT 2004
I'd like an opinion on the "platform" issue in RubyGems. I was
surprised to get this error when trying out a gemspec for ruby-dict.
$ gem -b ruby-dict.gemspec
Attempting to build gem spec 'ruby-dict.gemspec'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:333:in `validate': Missing value for att
ribute platform (Gem::InvalidSpecificationException)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:331:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:331:in `validate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:85:in `build'
from /usr/local/bin/gem:494:in `build'
from /usr/local/bin/gem:493:in `each'
from /usr/local/bin/gem:493:in `build'
from /usr/local/bin/gem:124:in `run'
There are a few points to make here.
1. The error message given there is a bit fearsome. I'm not sure what
the current policy on error messages is, but I'm sure this one can
be improved. I'll take advice and then make the change myself.
2. Why is a platform required? I understand platform to be "what kind
of machine this can run on", which is fine, but what does "Ruby"
mean as a platform? If a gem is platform-independent, does a
platform need to be specified? If we must have "Ruby" meaning
"platform-independent Ruby-based gem", can it be the default
Platform suggests to me a binary gem, I suppose.
3. Naming. I've brought this up before, but buried within a thread.
When I had "Gem::Platform::RUBY" specified as the platform for
"ruby-dict", it built fine, but the gem was named
That seems unappealing and unnecessary to me. If platform meant
purely a binary gem, then I could understand seeing gem names like
But I would prefer to see
And I prefer never to see
although the latter is more palatable :)
More information about the Rubygems-developers