From: Jeff Mitchell Date: 2004-06-25T06:26:48+09:00 Subject: Re: rubygems thoughts --- Lyle Johnson wrote: > On Fri, 25 Jun 2004 02:58:12 +0900, Jeff Mitchell > wrote: > > > [ piggybacking my request onto this thread :) ] > > > > Could someone show a hello-world example of creating a rubygem > > with an extension? I have followed the example, > > > > http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemInTenMinutes > > > > using s.extension << "..." without success. > > Could you be more specific about the "without success" part? Well there were several problems and I was hoping to mooch off a working example rather than slosh through it. But I've gotten a basic example working now. General questions: (1) s.require_path can only be one path? Errors occurred when I made it an array and when I made it colon-separated paths. (2) myclass.so is installed into gems/myclass-9.8.7/lib. That's not where it should go. myclass is part of a more complex project with a top-level directory and several subdirectories. When the extension lies in ext/mypackage/myclass/extconf.rb, it is still installed into the root of gems/myclass-9.8.7/lib. Can I control this somehow? (1) and (2) could be lumped together under "rubygems strips paths to make them incompatible with a conventional install." (3) [repeat from before] Is there a convention for prebuilt extensions? It would be nice if something like 'gem --use-binary -i myclass' would retrieve the prebuilt gem for the host platform if it exists, for example myclass-i686-linux-ruby18. (4) Are extensions guaranteed to be compatible among 1.8.x installs? If not, I suggest renaming libmsvcrt-ruby18.a to libmsvcrt-ruby181.a. > I somehow managed to get this to work the first time (I guess by > dumb luck) when experimenting with making a source gem for FXRuby > last night. My only concern was that when I actually installed the > gem, it did all of the configuration & build silently; if something > had gone wrong, I wouldn't have had any way to see the error(s). Hm? I see the all the compile commands happening. Also, there is a gem_make.out file in the directory with extconf.rb. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail