I have installed the latest release of ruby with "Sudo snap install ruby --classic" and i have confirmed with "which ruby" and "ruby -v" commands that the ruby exists and that the latest version ruby 3.2.2 also exists but whenever i tyried to run my rails app on the server i get this error "Your Ruby version is 3.0.2, but your Gemfile specified 3.2.2"
Asked
Active
Viewed 172 times
1 Answers
-1
I think your Ruby version is changing to 3.0.2 when you navigate to your Rails application repository or folder, you can try the following steps to potentially resolve the problem:
- Install RVM (Ruby Version Manager).
- Check if your preferred Ruby version is already installed using the command "rvm list".
- If your Ruby version is not installed, install it by running the command "rvm install 3.2.2" (replace "3.2.2" with your desired version).
- Set the Ruby version to be used by running the command "rvm use 3.2.2".
- give "bundle i"
OR
- Use the command "rvm --create --ruby-version 3.2.2" to create the .ruby-version file for automatic selection of the Ruby version.
- give "bundle install" command
Note: delete Gemfile.lock file before giving bundle install

veera mani
- 16
- 1