overmind icon indicating copy to clipboard operation
overmind copied to clipboard

Your Ruby version is 2.6.8, but your Gemfile specified ~> 3.1.2

Open mhenrixon opened this issue 3 years ago • 24 comments
trafficstars

Seems that it doesn't pick the ruby version from chruby. Any suggestions for how to make that work? I searched a bit but couldn't find anything relevant.

 ✘ ruby -v
#=> ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
 ✘ overmind start -f Procfile.dev
#=> system | Tmux socket name: overmind-consulting-FMV0KD1HEtqUT9VxHNN5ru
#=> system | Tmux session ID: consulting
#=> system | Listening at ./.overmind.sock
#=> worker | Started with pid 20814...
#=> assets | Started with pid 20812...
#=> web    | Started with pid 20813...
#=> yarn run v1.22.18
#=> $ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o #=> ./app/assets/builds/application.css --minify --postcss --watch
#=> worker | Your Ruby version is 2.6.8, but your Gemfile specified ~> 3.1.2
#=> web    | Your Ruby version is 2.6.8, but your Gemfile specified ~> 3.1.2
#=> worker | Exited
#=> assets | Interrupting...
#=> web    | Exited
#=> assets | Exited

mhenrixon avatar May 03 '22 19:05 mhenrixon

I'm having the same issue with asdf

existentialmutt avatar May 19 '22 19:05 existentialmutt

I fixed it somehow

mhenrixon avatar Jun 14 '22 12:06 mhenrixon

Same issue with rvm

denys-chaikovskyi avatar Jun 24 '22 12:06 denys-chaikovskyi

On a very basic level, Overmind doesn't do anything fancy but run tmux with commands from the Procfile. You can emulate the same behavior without Overmind involved:

  1. Create a test script: echo -e "#\!/bin/sh\nruby -v\nwhich ruby\nsleep 10" > ruby-test.sh
  2. Make it executable: chmod +x ruby-test.sh
  3. Run a new tmux server with it: tmux -L rubytest new ./ruby-test.sh

If it shows the wrong version too then Overmind is not a cause and you need to check your chruby/RVM/asdf installation.

DarthSim avatar Jun 28 '22 08:06 DarthSim

So, what I did to fix this with chruby was the following.

At the end of my config.fish I put this:

chruby_reset
chruby 3.1.2

mhenrixon avatar Jun 28 '22 09:06 mhenrixon

I believe it could be solved with some tmux config too most likely

mhenrixon avatar Jun 28 '22 14:06 mhenrixon

I'm running into the same. Trying to run a rake task and I get the same error message. Your Ruby version is 2.6.8, but your Gemfile specified ~> 3.1 (Bundler::RubyVersionMismatch) . I ran the script DarthSim suggested above and it displayed the "right" version (3.1).

Which ruby, which rake, which rails, which bundle, etc all seem to show 3.1. It seems as if it's trying to use my system ruby, which makes no sense. I'm using the latest version of chruby.

corinnpope avatar Aug 14 '22 22:08 corinnpope

@corinnpope thats because overmind is using your system ruby. You need to tell your bash profile or equivalent that your default ruby should be something else.

I think it doesn't matter the ruby version really, it just needs one ruby version that isn't your system ruby since that one requires different permissions and such.

Haven't tried it with different ruby versions.

Would be interested in trying out some tmux magic instead but honestly have zero experience with tmux.

mhenrixon avatar Aug 15 '22 04:08 mhenrixon

error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5

when I have created react project like npx react-native init AwesomeProject

girishmobile avatar Oct 21 '22 11:10 girishmobile

error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5

when I have created react project like

 npx react-native init AwesomeProject 

leanhvu21042001 avatar Oct 27 '22 07:10 leanhvu21042001

Follow below steps and your project will be created successfully.

  1. brew install chruby
  2. ruby-install ruby-2.7.5
  3. chruby ruby-2.7.5
  4. npx react-native init AwesomeProject

rahulthakurdash avatar Oct 27 '22 19:10 rahulthakurdash

Any update here?

AliRehman7141 avatar Nov 08 '22 10:11 AliRehman7141

I got this error when I tried creating a react-native app using npx react-native init AwesomeTSProject --template react-native-template-typescript Solution:

  1. I installed rbenv following https://github.com/rbenv/rbenv
  2. cd AwesomeTSProject/ios
  3. rbenv install 2.7.5 //if you don't have the version already installed
  4. rbenv local 2.7.5
  5. bundle install
  6. bundle exec pod install
  7. That's all!

sdavid501 avatar Nov 21 '22 00:11 sdavid501