ok, so I found the solution, there were several things wrong.
I didn't have .ruby-version file, so I created one and input 2.7.3
.
As mentioned in the comment, restarting the terminal helped pinpoint the problem further, as after the restart ruby --version
now outputted 2.6.3
.
I tried to rerun rbenv install
and rbenv global 2.7.3
but with the same results.
I found this question/answer about rbenv not updating ruby version, and I realized I didn't have a ./zsh_profile
or ./bash_profile
(on Mac you can check if you have such a file by pressing Cmd + shift + .
).
If you don't have such a file, create it via vim ~/.bash_profile
. Type i
to write and insert eval "$(rbenv init -)"
. Hit the esc
key and type :x
to exit vim mode.
Then run source ~/.bash_profile
.
See this answer for more information. If you have it, make sure you have the same content as described above.
The important point is that you see shims
when you run echo $PATH
.
I then restarted the terminal again and ruby --version
gave the correct version.
I rerun bundle install
and gem install rails
. I further had to rerun rails webpack:install
before the rails server was actually working.