1

我真的对宝石有一些问题。我正在尝试为 ruby​​ 安装 racc,以便它可以编译一些 *.y 文件。我正在使用我自己的带有 Ubuntu 的笔记本电脑。我的红宝石之路是

$ which ruby
/usr/bin/ruby

我是红宝石的大一新生。我尝试使用 sudo apt-get install racc 安装 racc。但它不起作用。顺便问一下,apt-get 和 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

这是有关我的系统的一些信息。

$ 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/

任何帮助表示赞赏。我几乎为它疯狂。

4

1 回答 1

2

我已经解决了。事实证明我需要安装一个完整的红宝石sudo apt-get install ruby-dev

于 2013-02-05T04:06:43.293 回答