gems install failed


W

wroxdb

Hello,

Sorry I'm totally new in ruby and gems.
I installed a module via gems failed this day. The error shows:

# gem install cassandra

Building native extensions. This could take a while...
ERROR: Error installing cassandra:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:21:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:21


Gem files will remain installed in
/var/lib/gems/1.8/gems/thrift-0.2.0.4 for inspection.
Results logged to /var/lib/gems/1.8/gems/thrift-0.2.0.4/ext/gem_make.out



I'm running ruby-1.8 in ubuntu 9.10.
How to fix it? thanks.
 
Ad

Advertisements

W

wroxdb

Sorry I have got it installed correctly.
Coz I shall install ruby1.8-dev firstly.

But another question:

irb(main):003:0* require 'rubygems'
=> true
irb(main):004:0> require 'cassandra'
=> true

what's the purpose of require 'rubygems'?
I found that if I didn't require rubygems then require cassandra will get fail.

Thanks.
 
J

Jeremy Bopp

Sorry I have got it installed correctly.
Coz I shall install ruby1.8-dev firstly.

But another question:

irb(main):003:0* require 'rubygems'
=> true
irb(main):004:0> require 'cassandra'
=> true

what's the purpose of require 'rubygems'?
I found that if I didn't require rubygems then require cassandra will get fail.

In the version of Ruby you're using, the rubygems module is not loaded
by default. Without rubygems loaded, the require method does not know
how to find your gems when you try to require them. Ruby 1.9 loads
rubygems by default, so it's optional to do so there.

If you don't want to explicitly require rubygems in your script, you can
also set an environment variable named RUBYOPT as follows to cause your
version of Ruby to load it automatically:

export RUBYOPT=-rubygems

Keep in mind that this environment variable would have to be set any
time you want to run your script with Ruby 1.8.

-Jeremy
 
Ad

Advertisements

W

wroxdb

what's the purpose of =A0require 'rubygems'?
t fail.

In the version of Ruby you're using, the rubygems module is not loaded
by default. =A0Without rubygems loaded, the require method does not know
how to find your gems when you try to require them. =A0Ruby 1.9 loads
rubygems by default, so it's optional to do so there.

If you don't want to explicitly require rubygems in your script, you can
also set an environment variable named RUBYOPT as follows to cause your
version of Ruby to load it automatically:

export RUBYOPT=3D-rubygems

Keep in mind that this environment variable would have to be set any
time you want to run your script with Ruby 1.8.

-Jeremy


OK Thanks a lot.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top