简体   繁体   中英

How to set Heroku Ruby version

I'm trying to deploy my Rails6 app to Heroku and Heroku is using a different Ruby version than my project

peter.walker@MACSB-RJ2CLKF45C friends % heroku run rake db:migrate
Running rake db:migrate on ⬢ ptw-friends... up, run.3636 (Free) 
Your Ruby version is 2.7.0, but your Gemfile specified 2.7.4

My Gemfile and Gemfile.lock both have

ruby '2.7.4'

RUBY VERSION
   ruby 2.7.4p191

But when I run $ heroku run "ruby -v" I get

peter.walker@MACSB-RJ2CLKF45C friends % heroku run "ruby -v"               
Running ruby -v on ⬢ ptw-friends... up, run.1142 (Free)
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

Any advise on how I can change the Heroku Ruby version?

After removing yarn.lock, node_modules, and Gemfile.lock and re-running yarn instal, bundle install, pushing to heroku it worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM