使用RVM,如何确保gems和非gems看到相同版本的ruby?
我尝试在 Ubuntu 上将 bdb 作为 gem 安装,如下所示,
gem install bdb
我没有使用 sudo,因为我使用 rvm 安装。我系统上的 ruby 版本是 1.9.1,但我用于此安装的版本是 1.8.7(我正在安装 rbot,你看)。我遇到的问题是:
checking for db_version() in -ldb-4.something... no
我认为这意味着 rubygems 没有在它正在查找的地方找到 ldb4.something 。这是因为我使用 sudo 安装了 libdb-4.something (实际上是 7),并且我的系统的 ruby 版本与我用于 bdb 的 ruby 版本不同?使用rvm,我应该如何处理这种情况?也许我做错了,但在我看来,我的问题是,并非我使用的所有东西都是 gem,而不是 gem 的东西是看到错误版本的 ruby。
(如果事实证明我的问题是完全不相关的:我仍然对这个问题感兴趣。我在系统上使用特定版本的 ruby 安装的东西如何与在不同版本的 ruby 下使用 rvm 安装的 gem 相处? )
I'm trying to install bdb on Ubuntu as a gem as follows,
gem install bdb
I'm not using sudo, since I am installing with rvm. The ruby version on my system is 1.9.1 but the version I'm using for this installation is 1.8.7 (I'm installing rbot, you see). The problem I've encountered is:
checking for db_version() in -ldb-4.something... no
I assume this means that rubygems is not finding ldb4.something in the places it is looking. Is this because I installed libdb-4.something (7, actually) using sudo, and my system's ruby version is different from the ruby version I'm using for bdb? Using rvm, how should I manage this sort of situation? Maybe I'm doing things wrong, but it seems to me that my problem is that not everything I'm using is a gem, and the stuff that isn't gems is seeing the wrong version of ruby.
(if it turns out that my problem is something completely unrelated: I am still interested in the question. How do things I've installed on my system with a particular version of ruby get along with gems installed using rvm under different versions of ruby?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“我在系统上使用特定版本的 ruby 安装的东西与在不同版本的 ruby 下使用 RVM 安装的 gem 如何相处?”
他们不这样做,这就是重点。 RVM用于管理不同版本的Ruby,使它们彼此隔离。
)无关。
这意味着您用于系统的 Ruby 版本(当您执行要安装到系统的 sudo gem install 时)与当前环境(正确设置后 在 RVM 环境中,安装的每个 Ruby 版本都是一个隔离的环境。
我的建议是:
如果您还有其他问题,请随时访问 Wayne E. Seguin 和 RVM 的众多其他用户,我们将很乐意为您提供帮助。当然,首先要寻找答案的是网站上的文档。
"How do things I've installed on my system with a particular version of ruby get along with gems installed using RVM under different versions of ruby?"
They don't, and that is the point. RVM is for managing different versions of Ruby so that they are isolated from each other.
This means that the Ruby versions that you use for system (when you do
sudo gem install
that would be installing to system) have nothing to do with the current environment (when properly set up.)When you are in a RVM environment, each version of Ruby installed is an isolated environment.
What I would recommend is this:
If you have additional questions, feel free to visit Wayne E. Seguin and a ton of other users of RVM and we will be happy to help you out. Of course, the first search for answers is the documentation on the web site.