Debian的rubygems有什么好处?这是不同而且奇怪的 [英] What's the deal with rubygems on Debian? It's different and strange

查看:138
本文介绍了Debian的rubygems有什么好处?这是不同而且奇怪的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经注意到Debian上的rubygems至少有以下的怪异(在我的情况下为5.0 lenny):




  • 软件包进入不同的安装位置:/ var / lib / gems vs / usr / lib / ruby​​ / gems

  • debian包是rubygems 1.3.6,并将rubygem更新到最新版本(1.3.7 )不起作用:



 
$ sudo gem update --system
错误:While执行gem ...(RuntimeError)
宝石更新 - 系统在Debian上禁用。可以使用aptitude或apt-get的官方Debian存储库更新RubyGems。




  • 并不是所有的宝石似乎像在其他系统上一样工作。例如,当安装Phusion Passenger时,即使安装了Phadle Passenger,它也没有检测到机架宝石。

  • 使用源压缩包手动安装rubygem并重新安装所有宝石(至/ usr / lib / ruby​​ / gems)使我的问题消失了。



什么是交易?为什么debian的包不同?

解决方案

请注意,我以下写的内容最近有很大的变化。 Debian Ruby团队或多或少彻底改革了他们的整个方法,包括但不限于包装RubyGems。我不知道Debian 6,但是在 之后的版本中,从Debian安装Ruby和RubyGems软件包应该是安全的,甚至可以推荐使用。显然,这也将悄悄进入Ubuntu。






混合到两个不同的包管理器通常是一个非常糟糕的想法。 Debian-Ruby团队尽力修补RubyGems,使其成为一个稍微不那么糟糕的主意。



此外,Debian还提供了一组旨在保持系统一致。 RubyGems 有自己的一套规则。这两套规则不幸不兼容。所以Debian-Ruby开发人员可以补丁RubyGems来尊重Debian的规则而不是RubyGems。将宝石从 / usr / lib / ruby​​ 移动到 / var / lib 是其中之一。



另一个问题是Debian稳定性很好,稳定。这意味着Debian团队保证整个系统(所有20000个软件包)在发布期间永远不会更改 的行为。但是,RubyGems开发人员不会单独使用它们的修补程序,获取错误修复的唯一方法是升级到具有(潜在)不同行为的新版本。因此,Debian-Ruby开发人员不能仅仅修改RubyGems的源代码,所以他们必须从1.3.7逆向工程化错误修复,并将它们应用到他们的 1.3.6版本,以确保向后兼容。 / p>

一般来说,您应该避免混合包管理器。使用RubyGems进行所有操作(在这种情况下,最好从源代码安装RubyGems,而不是使用Debian软件包)或使用APT进行所有操作,在这种情况下,您可能对 DebGem ,由Phusion家族(Ruby Enterprise Edition和Phusion Passenger的制造商)提供的服务,为几乎所有宝石提供Debian和Ubuntu软件包。


I've noticed at least the following oddities around rubygems on Debian (5.0 lenny in my case):

  • Packages go into a different installation location: /var/lib/gems vs /usr/lib/ruby/gems
  • The debian package is rubygems 1.3.6, and updating rubygems to the latest version (1.3.7) doesn't work:

  $ sudo gem update --system
  ERROR:  While executing gem ... (RuntimeError)
    gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

  • Not all gems appear to work like they do on other systems. For instance, when installing Phusion Passenger, it did not detect the "rack" gem even though it was definitely installed.
  • Manually installing rubygems using the source tarball and reinstalling all my gems (to /usr/lib/ruby/gems) made my problems go away.

What's the deal? Why is debian's package different?

解决方案

Note that what I wrote below has significantly changed recently. The Debian Ruby Team has more or less completely revamped their entire approach, including but not limited to their packaging of RubyGems. I'm not sure about Debian 6, but in the version after that, installing Ruby and the RubyGems package from Debian should be safe, maybe even recommended. And obviously, that is going to trickle down into Ubuntu as well.


[EDIT: The following is outdated as of Debian 7 at the latest.]

Mixing to two different package managers is generally a very bad idea. The Debian-Ruby team tries their best to patch RubyGems in such a way that it becomes a slightly less bad idea.

Also, Debian has a set of rules that are intended to keep the system consistent. RubyGems also has its own set of rules. Those two sets of rules are unfortunately not compatible. So, the Debian-Ruby developers patch RubyGems to respect Debian's rules instead of RubyGems's. Moving gems from /usr/lib/ruby to /var/lib is one of those things.

Another problem is that Debian stable is, well, stable. This means that the Debian team guarantees that the behavior of the entire system, all 20000 packages, will never change during a release. But the RubyGems developers don't make their bugfixes available separately, the only way to get a bugfix is to upgrade to a new version, with (potentially) different behavior. Therefore, the Debian-Ruby developers cannot just take the RubyGems sources unmodified, they have to reverse engineer the bugfixes from 1.3.7 and apply them to their version of 1.3.6, to ensure backwards compatibility.

In general, you should avoid mixing package managers. Either use RubyGems for everything (in which case it is best to install RubyGems from source instead of using the Debian package) or use APT for everything, in which case you might be interested in DebGem, a service by the Phusion guys (makers of Ruby Enterprise Edition and Phusion Passenger) which provides Debian and Ubuntu packages for pretty much all Gems.

这篇关于Debian的rubygems有什么好处?这是不同而且奇怪的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆