How can I choose Ruby version on Heroku?

后端 未结 3 1101
忘了有多久
忘了有多久 2020-12-25 13:28

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?

3条回答
  •  长发绾君心
    2020-12-25 14:30

    I wanted to use the version I already had defined in the .ruby-version file so I ended up creating a buildpack that can be used before heroku-buildpack-ruby that injects the version from the .ruby-version into the Gemfile. It also support versions without patch or aliases.

    https://github.com/platanus/heroku-buildpack-ruby-version

    This way you can have your version defined only in one place.

提交回复
热议问题