How to fix Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5 while server starting
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
How to fix Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
If you run ruby -v
you're going to see that you've installed Ruby 1.9.3, but the first line in your Gemfile specifies that you want to use Ruby 2.0.0.
You should either install Ruby 2.0.0 or change the first line in your Gemfile to specify Ruby 1.9.3.
sample of Gemfile:
source 'https://rubygems.org'
ruby "1.9.3"
gem 'pry'
gem 'pry-nav'
# Use with command-line debugging, but not RubyMine
#gem 'debugger'
gem 'bundler'
Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
I finally found out the solution in RVM documentation:
Pow has removed automated detection of rvm, here is how it can be
restored by creating .powenv in the root of the project, according to
Pow docs it should not be checked in to source control (unless all
team members agree on that).
These lines must be added to the .powenv
file at the root of your project. Then after restarting the server everything worked like a charm!
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if
[ -n "${rvm_path:-}" ] &&
[ -x "${rvm_path:-}/bin/rvm" ] &&
rvm_project_environment=`"${rvm_path:-}/bin/rvm" . do rvm env --path 2>/dev/null` &&
[ -n "${rvm_project_environment:-}" ] &&
[ -s "${rvm_project_environment:-}" ]
then
echo "RVM loading: ${rvm_project_environment:-}"
\. "${rvm_project_environment:-}"
else
echo "RVM project not found at: $PWD"
fi
In RubyMine: Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)
In RubyMine you can manage multiple SDKs, meaning ruby version and gemset.
Obviously you selected a SDK with ruby-2.0.0-p195.
The language level
only defines the syntax higliting and command completion help etc. say the support of the IDE, but not the ruby version used for the project.
So you should select a different SDK (or create it first, but as you use rmv
and RubyMine knows rmv, you should see all your SDKs)
If ruby-1.9.3 is your system default, you might install the same version again with rvm to make it available for RubyMine
rvm install ruby-1.9.3
and then select it in RubyMine.
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
I finally solved my problem using this thread Bundler not working with rbenv, could not find [gem],
by using these commands after reinstalling rbenv:
gem install --no-ri --no-rdoc bundler
rbenv rehash
bundle --path=vendor/bundle
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0
Run
gem install bundler
or
gem update bundler
which may fix your problem.
For all new installed versions of Ruby you should update or install a new bundler.
Related Topics
How to Iterate Through This JSON Document Using Ruby
Run Ruby Script That Is Stored on Internet
Generating Devise Controllers - Rails Devise
Ruby 2.1 with Erubis Template Engine
Adding Fields to Devise Sign Up Using Rails 4
Bundler How to Uninstall Conflicting Dependency
Share Session Between Two Rails4 Applications
Rails 4 Not Encrypting Cookie Contents
Ruby String Split into Words Ignoring All Special Characters: Simpler Query
Any Standard Guide for Ruby Win32Ole API
Uninitialized Constant Applicationrecord Error
Will_Paginate Can It Order by Day
Rails 4 - Heroku SQLite3 Error
Ruby on Rails - Pagination on Search Result
Nokogiri Fails to Install on Os X
Ruby: Looking for Ruby-Embeddable Interpreter or Scripting Language