2

我正在尝试在 Ubuntu 上安装 Rails:

sudo gem install rails

但我遇到了麻烦:

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

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


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/json-1.7.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out

问题是什么?

4

2 回答 2

12

正如丹尼尔在评论中所说,尝试执行sudo apt-get install ruby-dev

于 2013-02-19T23:44:29.117 回答
0

试试看,我已经在Ubuntu 12.4上安装成功了(安装时可以选择版本,根据你的要求....)

  1. sudo apt-get 更新
  2. sudo apt-get install build-essential git-core curl libmysqlclient18 nodejs

  3. sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) umask g+w

  4. 源 /etc/profile.d/rvm.sh

  5. sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison颠覆

  6. sudo chown -R [user]:[user] /usr/local/rvm 示例:sudo chown -R rohitporwal:rohitporwal /usr/local/rvm

  7. 源 /usr/local/rvm/scripts/rvm

  8. rvm 安装 1.9.2

  9. 须藤宝石安装导轨

于 2013-02-20T05:28:40.593 回答