我正在尝试在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
有什么问题?
答案 0 :(得分:12)
丹尼尔在评论中说,试着执行sudo apt-get install ruby-dev
答案 1 :(得分:0)
试试吧,我已经在Ubuntu 12.4上成功安装了(您可以在安装过程中选择版本,根据您的要求....)
sudo apt-get install build-essential git-core curl libmysqlclient18 nodejs
sudo bash -s stable&lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) umask g + w
source /etc/profile.d/rvm.sh
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 subversion
sudo chown -R [user]:[user] / usr / local / rvm 示例:sudo chown -R rohitporwal:rohitporwal / usr / local / rvm
source / usr / local / rvm / scripts / rvm
rvm install 1.9.2
sudo gem install rails