1

I really have some problems with gem. I'm trying to install racc for ruby so that it can compiler some *.y files. I'm working with my own laptop with Ubuntu. The path of my ruby is

$ which ruby
/usr/bin/ruby

I'm a freshman of ruby. I have tried to install racc with sudo apt-get install racc. But it doesn't work. By the way, what's the difference between apt-get and gem?

$ sudo gem install racc
Building native extensions.  This could take a while...
ERROR:  Error installing racc:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:3:in `<main>'


Gem files will remain installed in /home/jianqing/RubyGems/gems/racc-1.4.9 for inspection.
Results logged to /home/jianqing/RubyGems/gems/racc-1.4.9/ext/racc/gem_make.out

Here is some information about my system.

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [i686-linux]
  - INSTALLATION DIRECTORY: /home/jianqing/RubyGems
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /home/jianqing/RubyGems/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/jianqing/RubyGems
     - /home/jianqing/.gem/ruby/1.9.1
     - /var/lib/gems/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Any help is appreciated. I almost crazy for it.

user2038560
  • 137
  • 1
  • 7
  • 2
    Your problem is here `require: cannot load such file -- mkmf`. Plug that into SO search and out comes: http://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror – Casper Feb 04 '13 at 05:43

1 Answers1

2

I have already solved that. It turns out to be I need to install a full ruby with sudo apt-get install ruby-dev

user2038560
  • 137
  • 1
  • 7