DEV Community

Discussion on: dev.to open source help/discussion thread (v0)

Collapse
 
rhymes profile image
rhymes

Did you set 2.5.1 as the global version?

According to karloespiritu.github.io/cheatsheet... you need to type: rbenv global 2.5.1, otherwise it uses the default version shipped with the OS

Collapse
 
s_awdesh profile image
Awdesh

Thanks for the cheatsheet. Yes, I have tried rbenv global 2.5.1.

Thread Thread
 
rhymes profile image
rhymes

When you are in the directory of the project, what does rbenv version say?

Thread Thread
 
s_awdesh profile image
Awdesh

rbenv version
2.5.1 (set by /Users/awdesh/Documents/source/sandbox/dev.to/.ruby-version)

I feel like something is messed up with the /etc/paths/ although can't seem to figure it out. I am following this link here-: stackoverflow.com/questions/873067...

Thread Thread
 
andy profile image
Andy Zhao (he/him)

What's the output of ruby -v compared to rbenv version?

Try running rbenv shell 2.5.1 and then running bundle.

If not, a reinstall of 2.5.1 might help:

rbenv uninstall 2.5.1
# restart terminal
rbenv install 2.5.1
# install complete; restart terminal
ruby -v
#=> ruby -v version
rbenv version
#=> rbenv version

Let me know how it goes!

Thread Thread
 
s_awdesh profile image
Awdesh • Edited

Thanks Andy. I did a reinstall of rbenv and ran below.

❯ ruby -v

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin15]

❯ rbenv version
2.5.1 (set by RBENV_VERSION environment variable)

❯ rbenv shell 2.5.1

still see the same issue.

❯ bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.5.1

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Ah, your bundle install might be running from your old Ruby version as opposed to the latest one.

Try running which gem and which bundle. You should be seeing something similar to this output:

which gem
#=> /Users/username/.rbenv/shims/gem
:which ruby
#=> /Users/username/.rbenv/shims/ruby
:which bundle
#=> /Users/username/.rbenv/shims/bundle

If it's different, you'll probably see that bundle or gem are running from different paths than ruby.

Thread Thread
 
s_awdesh profile image
Awdesh • Edited

That did it. Thanks for the tip.

gem and ruby paths were same but bundle. I updated the PATH for bundle gem file using BUNDLE_GEMFILE

export BUNDLE_GEMFILE=/Users/awdesh/.rbenv/shims/bundle

restarted terminal

bundle install  #worked.
Thread Thread
 
andy profile image
Andy Zhao (he/him)

Awesome! Glad to know it worked. From my experience, it's "cleaner" to reinstall your gems per version, but I'm not too sure if it matters too much.

Thread Thread
 
co16353sidak profile image

Hey, I am currently working on some night mode bugs and my work mainly works on editing scss/css files,
nevertheless I want to run a local setup of the application in an attempt to check the changes I am making.
I am having the same error as above only that dev.to required ruby version 2.6.1 but it seems to be picking up 2.3.7 from my system macOS
I have followed all the steps but to no use, I have little to no experience in ruby. could use your help in the same.