1
我正在嘗試安裝ruby mysql gem。 gem install mysql
後,我得到:無法安裝MySQL gem/ruby-dev
Building native extensions. This could take a while...
ERROR: Error installing mysql:
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:5:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/mysql-2.9.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
我發現this answer推薦安裝ruby-dev
,但無論是apt-get install ruby1.9.1-dev
或apt-get install ruby-dev
後,我得到:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ruby1.9.1-dev : Depends: libruby1.9.1 (= 1.9.3.194-8.1ubuntu2) but 1.9.3.194-8.1ubuntu2.1 is to be installed
Recommends: ruby1.9.1 (= 1.9.3.194-8.1ubuntu2) but 1.9.3.194-8.1ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.
1)我怎樣才能解決這個問題?
2)更有趣的是:由於問題發生在新鮮的xubuntu安裝上,導致此類錯誤的原因是什麼?我是否設法在不知不覺中打破某些東西?我會欣賞鏈接到一個資源,這將有助於我理解Linux下的Ubuntu包管理器和依賴關係的方式。
您是否安裝了構建要領? – AndreDurao
是的,我已經安裝了必要的軟件包。 –
我是一樣的情況。你在某些方面解決了嗎? – ilpaijin