I have managed to get RubyGems 'install' to work (mostly). There were
a few additional minor fixes needed, and it only seems to work
(mostly) on local installs, but it's in some sense "working".

The changes:

- Added a few File::Stat methods that were easy and needed (ruby seems
to have a bit of duplication here, no?
- Fixed how define_method works when given a block (a return in that
block was causing a LocalJumpError). Ruby supposedly calls that block
from within an instance_eval, causing the return to return to that
eval. It seemed cumbersome to do it that way on our side (and I did
not confirm that behavior in the C code) but treating the block as a
lambda produces the same effect. This should be revisited, however,
since the current fix modifies the passed-in block directly, where the
block COULD still be used by someone else somewhere else.

The caveats:

- Only local gem installs seem to work correctly. There's something
buried within the zlib/socket/stream stuff that never seems to come
back from network installs.
- Local gems install their files fine, but documentation does not seem
to work correctly. rdoc appears to run against the current dir instead
of the gem install location as seen in the following trace:

ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory: C:/rubygems-0.8.11/lib/active_record
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:174:in `ftype'
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:174:in `normalized_file_list'
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:185:in `each'
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:175:in `normalized_file_list'
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:185:in `list_files_in_directory'
C:/jrubywork/jruby/lib/ruby/1.8/rdoc/rdoc.rb:170:in `normalized_file_list'

- The Teaser Revealed

I did manage to get Rails to install...a piece at a time. I had to
install its constituent gems by hand:

activesupport-1.2.5.gem
activerecord-1.13.2.gem
actionpack-1.11.2.gem
actionmailer-1.1.5.gem
actionwebservice-1.0.0.gem
rails-1.0.0.gem

In each case (excluding rails) the gems' files installed successfully,
but they subsequently failed to generate rdocs, producing the same
basic exception from above.

Now don't get excited yet. Rails still does, as before, have issues
running with RubyGems installed. I have not even begun to dig into
that. In general I believe the best course of action here is to
continue running Rails standalone (non-gemmed) and work on getting
simpler gems to install, require, and run correctly. Rake is a notable
working example, but others may fail like Rails does. Then there's
always RubyGems test cases...

I have committed all my changes. The lambda change is the most
dubious, so have a look if you're interested. A better solution is
welcome, but this was a pretty easy hack for the moment.

--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to