Ruby 1.9.3 是否使用 Ruby 1.91。网络堆栈?还是RVM把我搞砸了?

发布于 2024-12-29 16:33:29 字数 839 浏览 3 评论 0原文

好吧,我很困惑。在 Rails 3.1 项目中,我在 Ruby NET/SMTP 库中遇到分段错误(请参阅此 问题),并且该消息表明它发生在 NET/SMTP 库的 ruby​​ 1.9.1 版本中。然而,不久前我将 Ruby 版本更改为 1.9.3。为了验证我的 Ruby 版本,当我转到我的项目并启动 Rails 控制台时,我得到以下信息:

  irb(main):001:0> RUBY_VERSION

  => "1.9.3"

当我从项目目录查看 ruby​​ 版本时,我得到以下信息:

  story_project #   ruby --version

  ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

通过查看完整的版本,可以看到 1.9.1 的含义分段错误的路径:

  /Users/don/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault

这是怎么回事?为什么 Ruby 1.9.3 运行 1.9.1 中的代码?某个版本的 Ruby 与旧版本 Ruby 的整个库一起安装是很常见的吗?或者 RVM 是否有可能搞砸了?不确定这是否重要,但我正在 MacOS 10.7.2 上运行。

OK, I'm confused. In a Rails 3.1 project, I'm getting a segmentation fault in the Ruby NET/SMTP library (see this question) and the message indicates it is happening in the ruby 1.9.1 version of the NET/SMTP library. However, a while back I changed versions of Ruby to 1.9.3. To verify my Ruby version, when I go to my project and start the Rails console, I get this:

  irb(main):001:0> RUBY_VERSION

  => "1.9.3"

And when I look at the ruby version from the project directory I get this:

  story_project #   ruby --version

  ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

The 1.9.1 implication shows up by looking at the full path on the segmentation fault:

  /Users/don/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault

What is the deal here? Why is Ruby 1.9.3 running code from 1.9.1? Is it common for a version of Ruby to be installed with whole libraries from an older version of Ruby? Or is it possible that RVM messed this up some how? Not sure if it matters but I'm running on MacOS 10.7.2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野心澎湃 2025-01-05 16:33:29

我最近被这个问题困扰了:显然,因为标准库没有改变,所以他们没有提升版本。我从 Debian 软件包中获得了 1.9.3 与 1.9.2,但我知道它涵盖了全部内容。

I got bitten by this recently: apparently, because the standard library didn't change, they didn't raise the version. I got the 1.9.3 vs 1.9.2 from Debian packages, but understand it covers the whole thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文