I am getting this error while running server, how do I fix this?
You better install Ruby 2.2.5 for compatibility. The Ruby version in your local machine is different from the one declared in Gemfile.
If you're using rvm:
rvm install 2.2.5
rvm use 2.2.5
else if you're using rbenv:
rbenv install 2.2.5
rbenv local 2.2.5
else if you can not change ruby version by rbenv, read here
rvm use 2.6.1
gives Required ruby-2.7.0 is not installed. :) how can I fix this ? –
Weksler rvm get stable --auto-dotfiles
then bundler update --bundler
... and then, I could use rvm use 3.0.0
again, without errors/warnings –
Cholinesterase $HOME/.rbenv/shims
and $HOME/.rbenv/bin
) to my .zshrc fixed the problem. Thanks @Tan –
Withal If you have already installed 2.2.5 and set as current ruby version, but still showing the same error even if the Ruby version 2.3.0 is not even installed, then just install the bundler.
gem install bundler
and then:
bundle install
bundle check
or bundle install
will still be referencing the ruby environment that was used for installing bundler
originally. Cheers! –
Hindmost rbenv rehash
after reinstalling bundler. –
Hindmost If you are using rbenv then make sure that you run the "rbenv rehash" command after you set local or global ruby version. It solved the issue for me.
rbenv rehash
asdf reshim
for asdf users –
Globular Your Gemfile has a line reading
ruby '2.2.5'
Change it to
ruby '2.3.0'
Then run
bundle install
gem update
fixed the error message for me. –
Emanuel .ruby-version
also related ? –
Villiers Had same issue. I'm using rbenv
and which ruby
would show the rbenv version:
/Users/Mahmoud/.rbenv/shims/ruby
which bundle though would show:
/usr/local/bin/bundle
After looking in every possible place, turns out my problem was that I needed to update path in ~/.zshrc
in addition to ~/.bash_profile
(where I originally had the changes)
if you're running zsh add those two lines in ~/.zshrc
(or the equivalent file) in addition to ~/.bash_profile
export PATH="$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
After saving, quit terminal and relaunch before retrying. Hopefully this would help.
export PATH="$HOME/.rbenv/shims:$PATH" eval "$(rbenv init -)"
to ~/.bash_profile
–
Sire rbenv
docs. My project is a React Native project, if at all that helps someone else out there. –
Evenfall Two steps worked for me:
gem install bundler
bundle install --redownload # Forces a redownload of all gems on the gemfile, assigning them to the new bundler
I had this problem but I solved it by installing the version of the ruby that is specified in my gem file using the RVM
rvm install (ruby version)
After the installation, I use the following command to use the the version that you installed.
rvm --default use (ruby version)
You have to install bundler by using the following command in order to use the latest version
gem install bundler
After the above steps, you can now run following command to install the gems specified on the gemfile
bundle install
A problem I had on my Mac using rbenv was that when I first set it up, it loaded a bunch of ruby executables in /usr/local/bin - these executables loaded the system ruby, rather than the current version.
If you run
which bundle
And it shows /usr/local/bin/bundle you may have this issue.
Search through /usr/local/bin and delete any files that start with #!/user/bin ruby
Then run
rbenv rehash
it can also be in your capistrano config (Capfile
):
set :rbenv_ruby, "2.7.1"
Add the following to your Gemfile
ruby '2.3.0'
I am on Mac OS Sierra. I had to update /etc/paths
and add /Users/my.username/.rbenv/shims
to the top of the list.
If you have some dependency on the version of the Ruby , then install the appropriate version. otherwise change the version in the gemfile in the current directory.
rbenv install <required version>
rbenv local <required version>
Even after installation it was showing the same error for me, so I just restart the mac, then do the bundle install, it works :)
it should show something like this
<user>@<repo>% rbenv versions
system
* 2.3.7 (set by <app>)
Nothing above worked for me.
My issue was : Your Ruby version is 3.2.1, but your Gemfile specified 2.7.6.
Below Solution worked for me :
- Open project on VSCode
- Click around 11th option (=ruby-version) On the left side menu
- Change the current version to your current version (3.2.1) or whatever your ruby version is.
- in terminal run command
cd iOS
- then run command
bundle install
- then run
pod install
- Sometimes pod will give error about
installing boost
, so run pod install again, just keep repeating the command until it install everything successfully.
Your app is ready to run smoothly.
Refer the below link to install the required version.
https://nrogap.medium.com/install-rvm-in-macos-step-by-step-d3b3c236953b
$ \curl -sSL https://get.rvm.io | bash
rvm install 2.7.1
run:
rbenv global
if old version then run: 1)
brew update
brew install ruby-build 2) brew install rbenv 3) rbenv install 2.7.5 4) rbenv init 5) rbenv shell 2.7.5 6) eval "$(rbenv init - zsh)"
list commands for rbenv - run simple:
rbenv
you can install simple way. Install rbenv
On macOS with Homebrew
.
brew install rbenv ruby-build
vi ~/.zshrc
// openeval "$(rbenv init - zsh)"
// paste itrbenv install 3.1.2
- Close your Terminal window and open a new one so your changes take effect.
Really simple answer, better for teams with different versions of ruby, I would guess (good for development, maybe for high performance teams this isn't a good idea!). Change it to
ruby ">=2.2.5"
You better install Ruby 2.2.5 for compatibility. The Ruby version in your local machine is different from the one declared in Gemfile and then run:
rvm use 2.2.5
In my case i was not able to update my ruby version and rvm and rbenv didnt helped and it created lot of mess in envrionment variables, instead use this below solution, This worked for me:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
or use this link to install Homebrew - https://brew.sh/brew install ruby
follow the steps shown in terminal, i.e. echo path_shown_in_terminal and source path_shown_in_terminal
then just do ruby -v
to check latest ruby version.
For $
Your Ruby version is 2.3.0, but your Gemfile specified 2.4.1.
Changed 2.4.1 in Gemfile to 2.3.0
I install rvm and rbenv it not help me so i go the project and open Gemfile change the ruby version with recommend version and than follow the command cd ios -> bundle install
Your project is ready to Run now.
Open Gemfile and find ruby '2.2.5'
Change it to
ruby '2.3.0'
then install bundle
© 2022 - 2024 — McMap. All rights reserved.