Two Ruby version in my environment? - ruby

I have a gem that requires at least Ruby version 2.1.5, but my version is 2.2.2p95 (As shown by ruby -v, returning ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32])
I thought that the gem required only the version 2.1.5 and it wasn't compatible with newer versions of Ruby. So, my Gemfile now has the line ruby '2.1.5'
However, now when I run bundle install the console returns Your Ruby version is 1.9.3, but your Gemfile specified 2.1.5
I have not installed Ruby 1.9.3, I am confused as of where the console is getting this information.
I am considering downloading Ruby 2.1.5 to work on this project, but I honestly am unsure that this will solve the problem.

Related

Which version of Ruby is mintiest 5.14.1 gem compatible with?

When I run:
$ bundle install
I get this response:
Fetching gem metadata from https://rubygems.org/.........
minitest-5.14.1 requires ruby version ~> 2.2, which is incompatible with the
current version, ruby 3.0.0p0
I only have ruby 3.0.0p0 installed.
minitest gem page says:
Required ruby version >= 2.2, < 4.0
I assume this means anything up to Ruby 3.0.0p0 is compatible. However, that isn't what the error message says.
Not sure if this is a solution. I'd call it more of a work around.
Install ruby version 2.7.2
Update .ruby-version file in Jekyll to 2.7.2
That's it :)
Ideal solution would include identifying why Jekyll was dependent on minitest-5.14.1 (when only 5.14.4 was installed based on gem list).

Can't install bundler, shows version too old

I am trying to install wpscan to my system, but it shows an error to the ruby version for some reason, however it is sufficient for this install(>=2.3.0)
Error:
[root#ds wpscan]# gem install bundler
ERROR: Error installing bundler:
bundler requires Ruby version >= 2.3.0.
[root#ds wpscan]# ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[root#ds wpscan]#
Sounds like you've got multiple ruby installs and that gem is coming from the wrong one.
Try running which ruby and which gem to see if they can point you in the right direction.

Your Ruby version is 2.3.1, but your Gemfile specified 2.4.1 when running rails s

I am trying to upgrade from ruby 2.3.0 to 2.4.1.
To do this, I did rvm use 2.4.1#my-project --create (I am already using 2.4.1 for another project). I changed the gemfile from ruby "2.3.0" to ruby "2.4.1", and I ran bundle install. My gemfile.lock correctly changed.
However, when trying to run rails s in console, I have the error:
Your Ruby version is 2.3.1, but your Gemfile specified 2.4.1
This is not logical because when I am running which ruby I get the following answer : /.rvm/rubies/ruby-2.4.1/bin/ruby. ruby -v answers ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]. Furthermore I have never used 2.3.1 for any of my projects; when running rvm list in console, I do not see that version of ruby.
Is it possible that there is a conflict with rails? I am using rails 4.2.7.1
I tried all the answered given in the following stackoverflow issues:
Your Ruby version is 1.9.3, but your Gemfile specified 2.1.0
Your Ruby version is 2.3.0, but your Gemfile specified 2.1.2
Your Ruby version is 2.3.1, but your Gemfile specified 2.1.4
How to fix "Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0"
Your Ruby version is 2.2.4, but your Gemfile specified 2.3.0?
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0
So I am kind of running out of ideas. Thank you for your help!
I faced same issue, stopping spring and clearing tmp, which includes bootsnap cache worked for me
spring stop
rake tmp:clear

Ruby RVM gives me version 2.0 but Bundler says I'm incorrectly running version 2.3

I am just starting to work on an old Ruby Rails project. The Gemfile specifies:
ruby '2.0.0'
I am running a new version of Ubuntu, which I think came with Ruby 2.3 as the default. So I install RVM and then I:
rvm --default use 2.0.0
ruby -v
which gives me:
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
then I run:
bundle install
and I get this error:
Your Ruby version is 2.3.1, but your Gemfile specified 2.0.0
How do I get RVM to enforce the correct version of Ruby?

Not able to use ruby 2.1.0 even after installation

I downloaded and installed ruby 2.1.0.
Here's the output of ruby -v:
ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
So I specified the same version in my Gemfile. But when I run bundle, I get:
Your Ruby version is 1.9.3, but your Gemfile specified 2.1.0p0
And to add on, rvm list does not give me the list of rubies:
rvm rubies
$>
I'm new to Ruby and all I want to do is use the new Ruby version. Any idea what could be wrong?
starting with http://rvm.io/help you can find http://cheat.errtheblog.com/s/rvm and http://screencasts.org/episodes/how-to-use-rvm - make sure to read / watch both - in few minutes they should make it all clear.

Resources