Error when installing gem

I’m working on a project and am bundling up my APIs into a gem for
distribution. The gem includes native code that needs to be compiled, so
I’ve included an extconf.rb file, etc. to do this.

On a test machine the gem installs fine, the code is compiled, etc. and
things go well.

But on a development machine (one of my coworkers) the gem won’t
install. The problem is that some of our native libraries and heads on
which the gem depends aren’t in the standard locations; i.e., not in
/usr/lib and /usr/include. Instead they’re in the developer’s git repo.

When we install the gem command says:

—8—
Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/usr/bin/ruby
–with-qpid-dir
–without-qpid-dir
–with-qpid-include
–without-qpid-include=${qpid-dir}/include
–with-qpid-lib
–without-qpid-lib=${qpid-dir}/lib
–with-stdc++lib
–without-stdc++lib
–with-qpidclientlib
–without-qpidclientlib
—8—

But when I include “–without-qpid-dir=~/Programming/Qpid/builddir/src”
(the location of all of the libraries in my development environment) gem
gives me:

ERROR: While executing gem … (OptionParser::InvalidOption)
invalid option: --without-qpid-dir=~/Programming/Qpid/builddir/src/

What’s the problem and what does it expect?

Darryl Pierce wrote in post #1024793:

[…]

ERROR: While executing gem … (OptionParser::InvalidOption)
invalid option: --without-qpid-dir=~/Programming/Qpid/builddir/src/

What’s the problem and what does it expect?

gem install – --with-opt-for-gem=…
^^

Note the double slashes to separate options for RubyGems than the
options you provide to the gem installation.

All this is detailed in the RubyGems inline help:

gem help install


Luis L.

On 10/03/2011 07:40 PM, Luis L. wrote:

Note the double slashes to separate options for RubyGems than the
options you provide to the gem installation.

All this is detailed in the RubyGems inline help:

gem help install

Still no joy.

[email protected]:pkg (qpid-nonblocking-io-separate-threads) $
gem install qpid-0.13.0.gem –
–with-qpid-lib=~/Programming/Qpid/builddir/src/
–with-qpid-include=~/Programming/Qpid/qpid/cpp/include/
Building native extensions. This could take a while…

ERROR: Error installing qpid-0.13.0.gem:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb

–with-qpid-lib=~/Programming/Qpid/builddir/src/
–with-qpid-include=~/Programming/Qpid/qpid/cpp/include/
checking for main() in -lstdc++… yes
checking for main() in -lqpidclient… no
Missing required library: qpidclient
*** extconf.rb failed ***

The directory pointed to by --with-qpid-lib (I also tried
–with-qpid-dir) exists and contains libqpidclient.so, which is not
being found in the above.

On Tue, Oct 4, 2011 at 10:06 AM, Darryl L. Pierce [email protected]
wrote:

       ^^

[email protected]:pkg (qpid-nonblocking-io-separate-threads) $
gem install qpid-0.13.0.gem –
–with-qpid-lib=~/Programming/Qpid/builddir/src/
–with-qpid-include=~/Programming/Qpid/qpid/cpp/include/

From the directories you’re feeding into gem install, seems to me that
you didn’t compile and install the Qpid library.

Please read the library documentation about configure, compile and
installation, but you should have a “libqpidclient.a” inside “lib”
directory of the directory you’re pointing.

From here it seems you’re pointing to the source code instead.

The directory pointed to by --with-qpid-lib (I also tried
–with-qpid-dir) exists and contains libqpidclient.so, which is not
being found in the above.

The so (shared object) is the compiled library and is for execution,
you the linking library instead (.a)

Also, is polite reply to the list so all benefit from the answers.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs