Ruby version cannot be specified correctly under Rails environment in Mac OS

Asked 2 years ago, Updated 2 years ago, 42 views

What can be considered in the following cases?
This is the result of hitting the command in the root directory of the rails app.

$rails
Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2

$ ruby-v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]

$ rbenv versions
  system
* 2.2.2 (set by / Users / username / Documents / workspace / rails_root / .ruby-version )

$ rbenv versions --local
  system
* 2.2.2 (set by / Users / username / Documents / workspace / rails_root / .ruby-version )

I am using zsh, but the contents of ~/.zprofile are like this.

export PATH="$HOME/.rbenv/bin:$PATH"
event "$(rbenv init-)"

which bundle runs
Returns /Users/username/.rbenv/shims/bundle.

You can do bundle update and bundle install.

Thank you for your cooperation.

ruby-on-rails ruby

2022-09-30 19:45

1 Answers

I am sorry if you have already checked.
Is there a possibility that bundleler is not installed in ruby 2.2.2 of rbenv?

 which bundle

The result of running is

/usr/bin/bundle

If so, ruby 2.2.2 bundle is not installed, so

gem install bundleer

Install the bundle on the .


2022-09-30 19:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.