Is it possible to run my Rails app on Heroku with Ruby 1.9.3? If so, how?

后端 未结 6 1363
闹比i
闹比i 2021-02-02 00:21

I tried this tip: https://github.com/thoughtbot/laptop/pull/14#issuecomment-3192270 .

On deploy I see

-----> Using RUBY_VERSION: ruby-1.9.3-p0
         


        
6条回答
  •  情歌与酒
    2021-02-02 00:56

    Right, so Ruby 1.9.3 is definitely possibly. As you said hacky/experimental solutions were accepted - this is definitely one of them.

    It's actually really simple;

    1. Enable Heroku Labs's user_env_compile feature for your application.

    2. Set a heroku config variable to RUBY_VERSION to ruby-1.9.3-p0 (heroku config:add RUBY_VERSION=ruby-1.9.3-p0)

    3. ENSURE that the heroku PATH config variable has bin at the front (heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin)

    When you next deploy you should see your application using 1.9.3 - the deployment output will show this too;

    -> Heroku receiving push
    -----> Ruby/Rails app detected
    -----> Using RUBY_VERSION: ruby-1.9.3-p0
    -----> Installing dependencies using Bundler version 1.1.rc.7
    Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
    

提交回复
热议问题