0

I followed the instructions and thoughts raised in this question: "Why do I get the error “Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2” although I have 2.2.2 installed 2"

I have the same error after problems with /User folder when a script removed the folders preceding with "." which included the .rbenv folder.

After a rebuild of rails, rbenv and such. Im still getting the error from rails

"Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2"

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Users/chris/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: /Users/chris/.rbenv/versions/2.2.2/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/chris/.rbenv/versions/2.2.2/bin
  - SPEC CACHE DIRECTORY: /Users/chris/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/chris/.rbenv/versions/2.2.2/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
  - GEM PATHS:
     - /Users/chris/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0
     - /Users/chris/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "-n/usr/local/bin"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/chris/.rbenv/versions/2.2.2/bin
     - /usr/local/Cellar/rbenv/0.4.0/libexec
     - /Users/chris/.rbenv/shims
     - /Users/chris/.rbenv/bin
     - /usr/local/bin
     - /usr/local/sbin
     - /usr/local/mysql/bin
     - /Library/PostgreSQL/9.4/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

Here is the current version:

$ rbenv versions
  system
* 2.2.2 (set by /Users/chris/Dropbox/git/frontend.1/.ruby-version)
  2.2.3

Current .bash_profile

PS1="\u$ "
alias ll="ls -lahG"

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Library/Postg$
export PATH="$HOME/.rbenv/bin:$PATH"

I tried this:

gem install --no-ri --no-rdoc bundler
rbenv rehash
bundle --path=vendor/bundle

But it did not fix or change the error.

Community
  • 1
  • 1
Barklem
  • 91
  • 1
  • 11

1 Answers1

3

Your bash init script looks like you didn't finish installing rbenv correctly. First of all, it seems that you've installed rbenv with Homebrew. That's OK, but you should update it before you proceed:

brew update && brew upgrade rbenv

If you installed with Homebrew, then you don't need this line in your .bash_profile

# remove this line
export PATH="$HOME/.rbenv/bin:$PATH"

However, you need to add this line to the end of your .bash_profile:

# add this line
eval "$(rbenv init -)"

Now, open a new terminal window, then

rbenv version #=> 2.2.2
gem i bundler --no-rdoc -no-ri
which bundle #=> ~/.rbenv/shims/bundle

Now you can run bundle install in your project.

mislav
  • 14,919
  • 8
  • 47
  • 63