Ruby 1.9.3 是否使用 Ruby 1.91。网络堆栈?还是RVM把我搞砸了?
好吧,我很困惑。在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近被这个问题困扰了:显然,因为标准库没有改变,所以他们没有提升版本。我从 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.