![](/img/trans.png)
[英]Ubuntu instaled ruby-dev but still can not install gem nokogiri
[英]Cannot install mysql gem / ruby-dev
我正在嘗試安裝ruby mysql gem。 gem install mysql
我得到:
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
我找到了建議安裝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軟件包管理器的方式和依賴項。
我在Ubuntu 14.04上遇到了同樣的問題。 我刪除所有的ruby,ruby-1.9,ruby-dev軟件包,然后重新安裝ruby和ruby-dev。 看來我現在可以通過gem安裝ruby軟件了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.