Every time a command is executes with sudo
(for instance: sudo rake db:seed
or sudo bundle
) an error is thrown: Your Ruby version is 1.9.3, but your Gemfile specified 2.2.1
.
When I hit ruby -v
it's ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
so I guess it's not the problem.
In addition I use rvm to manage the versions and when I list them with rvm list
the output is:
rvm rubies
=* ruby-2.2.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
So what causes this error to be thrown? It has something to do with the root user configuration?
You can try command
rvmsudo
(more information here).