Problem with building gem, require path

Discussion in 'Ruby' started by Daniel Berger, Jun 4, 2005.

  1. Hi all,

    Windows XP
    Ruby 1.8.2

    I'm having a bit of trouble building a proper gem for one of the
    Win32Utils packages (win32-ipc). This is a C extension. Everything
    appears to be fine, except that it installs the shared library (.so)
    under "lib", instead of "lib/win32". I've set the Gem#required_paths,
    so I'm not sure what I'm doing wrong.

    Here is the spec:

    require "rubygems"

    spec = Gem::Specification.new do |gem|
    gem.name = "win32-ipc"
    gem.version = "0.4.1"
    gem.author = "Daniel J. Berger"
    gem.email = ""
    gem.homepage = "http://www.rubyforge.org/projects/win32utils"
    gem.platform = Gem::platform::WIN32
    gem.summary = "A base class for Win32 synchronization objects."
    gem.require_paths << "lib/win32"
    gem.test_file = "test/tc_ipc.rb"
    gem.has_rdoc = true
    gem.extra_rdoc_files = ["CHANGES","README"]
    gem.extensions = ["extconf.rb"]
    gem.rubyforge_project = "win32utils"

    files = Dir["doc/*"] + Dir["examples/*"] + Dir["lib/win32/*"]
    files += Dir["test/*"] + Dir["[A-Z]*"]
    files.delete_if{ |item| item.include?("CVS") }
    gem.files = files
    end

    if $0 == __FILE__
    Gem.manage_gems
    Gem::Builder.new(spec).build
    end

    The result is ipc.so installed under
    c:/ruby/lib/ruby/gems/1.8/gems/win32-ipc-0.4.1-mswin32/lib instead of
    the desired
    c:/ruby/lib/ruby/gems/1.8/gems/win32-ipc-0.4.1-mswin32/lib/win32.

    Any ideas? I've tried a few things for 'required_libs' without
    success.

    Regards,

    Dan
    Daniel Berger, Jun 4, 2005
    #1
    1. Advertising

  2. Daniel Berger wrote:

    > I'm having a bit of trouble building a proper gem for one of the
    > Win32Utils packages (win32-ipc). This is a C extension. Everything
    > appears to be fine, except that it installs the shared library (.so)
    > under "lib", instead of "lib/win32". I've set the Gem#required_paths,
    > so I'm not sure what I'm doing wrong.


    > gem.require_paths << "lib/win32"


    Hello,

    i found that rubygems copies the libraries in the first require_path,
    regardless which path stands in the mkmf create_makefile command. Thats
    because installer.rb of rubygems overrides the RUBYARCHDIR and RUBYLIBDIR
    variables of the resulting Makefile not considering the target_prefix.
    I think its meant to require all files with the autorequire, so the actual
    location of the library doesn't matter.
    Try gem.require_paths = ['lib/win32','.'] or something to make sure your
    desired path is in front or nevermind at all.
    I mentioned the use of target_prefix in the Makefile on
    Rubygems-developers-mailinglist, but nobody seems to notice.
    Stefan
    Stefan Achatz, Jun 5, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Hickman
    Replies:
    2
    Views:
    88
    Peter Hickman
    Aug 19, 2005
  2. Michael Glaesemann

    gem query finds gem, yet require fails

    Michael Glaesemann, Nov 12, 2006, in forum: Ruby
    Replies:
    5
    Views:
    147
    Michael Glaesemann
    Nov 26, 2006
  3. Austin 7873
    Replies:
    5
    Views:
    179
    Eric Hodel
    Jan 27, 2007
  4. Daniel Berger
    Replies:
    2
    Views:
    146
    Daniel Berger
    Sep 12, 2008
  5. Marc Hoeppner

    Ruby gem , require and version problem

    Marc Hoeppner, Nov 26, 2009, in forum: Ruby
    Replies:
    1
    Views:
    88
    Ryan Davis
    Nov 26, 2009
Loading...

Share This Page