win32utils-devel@rubyforge.org
2004-Mar-14 23:48 UTC
[Win32utils-devel] Re: [ANN] RubyGems 0.2.0
Hello Chad, I installed and tried out rubygems for one of the win32-utils projects named win32-mmap. This is on Win XP (Home). Here is how I did it but got some errors (see at the end). I must be doing something wrong. Please help ... -- Shashank #------------------------------------------------------------ require ''rubygems'' spec = Gem::Specification.new do |s| s.add_dependency(''ruby'', ''= 1.8.1'') s.name = ''win32-mmap'' s.version = "0.0.2" s.platform = Gem::Platform::RUBY s.summary = "win32-mmap is a pure-Ruby library for handling memory mapped files on MS Windows" s.requirements << ''Win32 Compiler'' s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")} s.require_path = ''win32'' # also tried ''lib/win32'' s.autorequire = ''win32-mmap'' s.author = "Dan Berger;Park Heesob" s.email = "win32utils-devel@rubyforge.org" s.rubyforge_project = "win32-mmap" s.homepage = "http://win32utils.rubyforge.org" end if $0==__FILE__ Gem::Builder.new(spec).build end __END__ #------------------------------------------------------------ The directory tree looks like this: C:\win32utils\win32-mmap>tree Folder PATH listing Volume serial number is 71FAE346 6B0E:6992 C:. +---doc +---lib | +---win32 | +----- mmap.so +---test C:\win32utils\win32-mmap> C:\win32utils\win32-mmap>ruby win32-mmap.gemspec Successfully built RubyGem Name: win32-mmap Version: 0.0.2 File: win32-mmap-0.0.2.gem C:\win32utils\win32-mmap>gem -i win32-mmap-0.0.2.gem c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:25:in `require_gem'': (LoadError) Could not find RubyGem ruby from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:38:in `install'' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:37:in `each'' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:37:in `install'' from c:/ruby/bin/gem:59 C:\win32utils\win32-mmap>
win32utils-devel@rubyforge.org
2004-Mar-15 00:48 UTC
[Win32utils-devel] Re: [ANN] RubyGems 0.2.0
Chad, Never mind !> I must be doing something wrong.Yes, and I figured it out ... <snip>> s.add_dependency(''ruby'', ''= 1.8.1'')^^^^^^^^^^^^^^^^^^^^^^^ Commented out this line and then it worked. Didn''t realize first that this was a gem dependency. Sorry for the noise. -- Shashank P.S> This is really cool :-)
win32utils-devel@rubyforge.org
2004-Mar-15 09:07 UTC
[Win32utils-devel] Re: [ANN] RubyGems 0.2.0
Chad,> I forgot to ask one thing! Shall we put your gems up on > http://gems.rubyforge.org? We haven''t yet figured out how we want to > support binary gems when they can work across platforms, but for > windows-only gems like these, there''s no reason we can''t make them > available.Why not ? Let me know what I should do next. Allow me to finish up my testing and get an OK from the other team members before we open it up for the world. What do you say, Dan? Park? Meanwhile a few more questions. I haven''t quite understood the purpose of the following lines in gemspec: #----------------------------------------- ## What other platform can it be? s.platform = Gem::Platform::RUBY ## What do these lines do and how to mention multiple requirements? s.requirements << ''drb'' s.require_path = ''lib'' s.autorequire = ''legoR'' #----------------------------------------- And it seems I cannot get uninstall to work: C:\legoR>gem -i legoR-0.0.1.gem Successfully installed legoR version 0.0.1 C:\legoR>gem -u legoR-0.0.1.gem Unknown RubyGem: legoR-0.0.1.gem-> 0.0.0 C:\legoR>tree c:\ruby\lib\ruby\gems Folder PATH listing Volume serial number is 71FAE346 6B0E:6992 C:\RUBY\LIB\RUBY\GEMS ????1.8 ????cache ????doc ????legoR-0.0.1 ? ????lib ? ????legoR ????sources-0.0.1 ? ????lib ????specifications ????win32-mmap-0.0.2 ????lib ????win32 C:\legoR>
win32utils-devel@rubyforge.org
2004-Mar-15 18:41 UTC
[Win32utils-devel] Re: [ANN] RubyGems 0.2.0
On Mon, 15 Mar 2004, Shashank Date wrote: # Chad, # # # > I forgot to ask one thing! Shall we put your gems up on # > http://gems.rubyforge.org? We haven''t yet figured out how we want to # > support binary gems when they can work across platforms, but for # > windows-only gems like these, there''s no reason we can''t make them # > available. # # Why not ? Let me know what I should do next. # The easiest thing to do would be to create the gems and release them in RubyForge. We are going to write a script to run on RubyForge that grabs all of the released gems from the project files area. For now, just let me know when they''re up and we can do it manually. # # Meanwhile a few more questions. I haven''t quite understood the purpose # of the following lines in gemspec: # # #----------------------------------------- # ## What other platform can it be? # s.platform = Gem::Platform::RUBY # # ## What do these lines do and how to mention multiple requirements? # s.requirements << ''drb'' # s.require_path = ''lib'' # s.autorequire = ''legoR'' # #----------------------------------------- # We really need to document this better: "requirements" are things like "Windows", "A web server", or "Enough patience to deal with an alpha release"--things you can''t check for programatically, but the user can read. "require_path" is where the LOAD_PATH needs to be set in relation to your installed gem. In legoR, for example, you put your library code under "lib", so the require_path you have above is correct. If you just had the code in the root of the distribution, you would set require_path to blank. When you run the following: require_gem ''legoR'' ...it will look in the lib directory for the most recent version of legoR that you have installed, at which point it will "autorequire" legoR.rb (which means it actually loads the library). require_gem really just modifies the LOAD_PATH, so you will almost always want to specify an auto_require for your gem. # And it seems I cannot get uninstall to work: # # C:\legoR>gem -i legoR-0.0.1.gem # Successfully installed legoR version 0.0.1 # # C:\legoR>gem -u legoR-0.0.1.gem # Unknown RubyGem: legoR-0.0.1.gem-> 0.0.0 # We need to add this in as a feature (running an uninstall on a gem file). We''ll put it in the next release. For now, you can do: gem -u legoR --version 0.0.1 Thanks for the help and support! The only way to make this thing stick and finally solve the "Ruby has no CPAN" problem is to get gems made! Chad