I have an existing project which is using ruby version 2.6.6. But my machine ruby version is 3.0.2. So when I try to run my project on my machine it shows this error.
Your Ruby version is 3.0.2, but your Gemfile specified 2.6.6
So I also try to install ruby 2.6.6 using rbenv envirourment
rbenv install 2.6.6
Installing ruby-2.6.6...
BUILD FAILED (Ubuntu 22.04 using ruby-build 20220426)
Inspect or clean up the working tree at /tmp/ruby-build.20220501122810.9309.e7yCPU
Results logged to /tmp/ruby-build.20220501122810.9309.log
Last 10 log lines:
installing default date_core libraries
linking shared-object fiddle.so
make[2]: Leaving directory '/tmp/ruby-build.20220501122810.9309.e7yCPU/ruby-2.6.6/ext/readline'
make[2]: Leaving directory '/tmp/ruby-build.20220501122810.9309.e7yCPU/ruby-2.6.6/ext/fiddle'
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20220501122810.9309.e7yCPU/ruby-2.6.6/ext/bigdecimal'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20220501122810.9309.e7yCPU/ruby-2.6.6/ext/date'
make[1]: Leaving directory '/tmp/ruby-build.20220501122810.9309.e7yCPU/ruby-2.6.6'
make: *** [uncommon.mk:286: build-ext] Error 2
So I not sure how to make it work. Anybody can help with this. I try all the possible way from the internet but it doesnt work.
ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
Rails -v
Rails 6.1.4.1
Rbenv --version
rbenv 1.1.2
Ruby-build log file link here.