为什么Heroku Stack Traces指示Ruby 1.9.1正在使用中? [英] Why Do Heroku Stack Traces indicate Ruby 1.9.1 is in use?

查看:117
本文介绍了为什么Heroku Stack Traces指示Ruby 1.9.1正在使用中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  /usr/local/lib/ruby/1.9.1最近,我们在雪松上的Heroku应用程序中看到了这个堆栈跟踪。 /uri/common.rb:156:in`split'
/usr/local/lib/ruby/1.9.1/uri/common.rb:174:in`parse'
/ usr / local /lib/ruby/1.9.1/uri/common.rb:628:in`parse'

为什么使用Ruby 1.9.1?



我的Gemfile没有指定Ruby版本。 Heroku的文档显示我们应该获得Cedar默认值1.9.2



https://devcenter.heroku.com/articles/ruby-versions



编辑:



ruby​​ -v似乎报告了正确的版本

  $ heroku运行ruby -v
运行`ruby -v`连接到终端... up,运行2594
ruby​​ 1.9.2p290(2011-07-09修订版32553)[x86_64-linux]


解决方案

实际上并没有使用Ruby 1.9.1 - 此答案 Marc-AndréLafortune 解释说,它与C接口有关,自从Ruby 1.9.1以来它一直没有改变。


在Ruby 1.9.0中,C接口从Ruby 1.8系列改为了



必须重新编译编译为本地代码的Gem。



Ruby 1.9.1中的界面再次发生了变化,并且在Ruby 1.9.2& 3.这解释了你在你的路径中看到的1.9.1。



这个想法是你可以在你的系统上安装不同版本的Ruby,并且这些gem将被共享在具有相同C api的组内。所以Ruby 1.8.6和1.8.7可以分享他们的宝石,Ruby 1.9.1,.2和.3也是如此。



这不一定是最好的想法,虽然。无论如何,大多数人使用rvm来访问不同版本的Ruby,并且rvm保持每个版本的gem独立,而不考虑C api版本。



Recently saw this stack trace on our Heroku app on cedar

/usr/local/lib/ruby/1.9.1/uri/common.rb:156:in `split'
/usr/local/lib/ruby/1.9.1/uri/common.rb:174:in `parse'
/usr/local/lib/ruby/1.9.1/uri/common.rb:628:in `parse'

Why is it using Ruby 1.9.1?

My Gemfile is not specifying a Ruby version. Heroku's docs suggest that we should be getting the Cedar default of 1.9.2

https://devcenter.heroku.com/articles/ruby-versions

EDIT:

ruby -v appears to report the correct version

$ heroku run "ruby -v"
Running `ruby -v` attached to terminal... up, run.2594
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

解决方案

It's not actually using Ruby 1.9.1 -- as this answer from Marc-André Lafortune explains, it has to do with the C interface, which hasn't changed since Ruby 1.9.1.

In Ruby 1.9.0, the C interface was changed from the Ruby 1.8 series.

Gems that compile to native code had to be recompiled.

The interface was again changed in Ruby 1.9.1 and kept the same in Ruby 1.9.2 & 3. This explains the 1.9.1 you are seeing in your path.

The idea is that you can install different versions of Ruby on your system and that gems would be shared within groups having the same C api. So Ruby 1.8.6 and 1.8.7 could share their gems, and so could Ruby 1.9.1, .2 and .3.

It's not necessarily the best idea, though. In any case, most people use rvm to access different versions of Ruby and rvm keeps gems separate for each version, irrespective of the C api version.

这篇关于为什么Heroku Stack Traces指示Ruby 1.9.1正在使用中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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