我如何选择Heroku上的Ruby版本? [英] How can I choose Ruby version on Heroku?

查看:137
本文介绍了我如何选择Heroku上的Ruby版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Rails 3应用程序中使用了Ruby 1.9.x语法,但在推向Heroku后,由于旧版本的Ruby版本(1.8)而崩溃。如何控制它?

I use Ruby 1.9.x syntax in my Rails 3 app, but after pushing it to Heroku it crashes due to older Ruby version (1.8). How can I control it?

推荐答案

Heroku目前的堆栈Cedar默认使用1.9.2。 Cedar还支持在您的Gemfile中指定Ruby版本。目前, 1.9.2和1.9.3是有效的选项。 p>

Heroku's current stack, Cedar, uses 1.9.2 by default. Cedar also supports specifying the Ruby version in your Gemfile. Currently, 1.9.2 and 1.9.3 are valid options.

# Gemfile
source "https://rubygems.org"
ruby "1.9.3"
...

Ruby支持文章中提供了更多详细信息: https://devcenter.heroku.com/articles/ruby-support

More details are available in the Ruby support article: https://devcenter.heroku.com/articles/ruby-support

如果您正在使用Aspen或Bamboo,则可以使用堆栈切换到1.9.2:migrate 命令:

If you are currently using Aspen or Bamboo, you can switch to 1.9.2 by using the stack:migrate command:

$ heroku stack:migrate bamboo-mri-1.9.2

您目前无法自动迁移到Cedar堆栈,但有如何操作的指导: https://devcenter.heroku.com/articles/cedar-migration

You cannot automatically migrate to the Cedar stack at this time, but there is a guide on how to do so: https://devcenter.heroku.com/articles/cedar-migration

这篇关于我如何选择Heroku上的Ruby版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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