Which version of Ruby is mintiest 5.14.1 gem compatible with? - ruby

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).

Related

public_suffix requires Ruby version >= 2.3 while installing fastlane

Getting following error public_suffix requires Ruby version >= 2.3. while installing fastlane
i am using ruby 3.0
ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Installing fastlane
sudo gem install fastlane
getting below error
ERROR: Error installing fastlane:
public_suffix requires Ruby version >= 2.3.
https://github.com/weppos/publicsuffix-ruby/blob/v4.0.6/public_suffix.gemspec#L23
specifies that public_suffix requires a ruby version >= 2.x - so I believe that it will not, unfortunately, permit 3.x as a dependency.
See In a ruby .gemspec file, how do I specify multiple versions of a dependency?
This is something that needs to be done by the gem maintainer. It's also a fanstastic example of dependency hell in the wild.

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

How to Specify Gem Dependency Version at Gem Install Time

I am working with a gem that has a dependency whose version must vary depending on which Ruby version is running when the gem is installed. Specifically, the current version of the nio4r gem requires Ruby version >= 2.2.2, and the async gem that needs nio4r should ideally be able to run on any Ruby version >= 2.0.
I tried putting some code into the gemspec file to vary the version, but it seems that it is executed when the gem is built, not when it is installed. In other words, the nio4r version is hardcoded into the gem based on whatever version of Ruby is used to build the gem. Here's the code I tried in the gemspec (say is an OS X command to speak a string and was very helpful in knowing what was happening and when; I would of course remove it later).
# Recent versions of nio4r require a Ruby version >= 2.2.2.
# If the version used is earlier, load an earlier version of nio4r.
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.2')
`say Installing latest version of nio4r`
spec.add_runtime_dependency "nio4r"
else
`say Installing nio4r version 1.2.1`
spec.add_runtime_dependency "nio4r", '1.2.1'
end
As I said, this was executed on gem build and not install. I am aware that I can use bundler for this kind of thing and put the specification in the Gemfile, but as far as I can tell that file will not be used when the gem is gem install'ed.
How can I get the dependent's gem version to vary at gem install time?
I'm looking for a solution that is automated, that is, does not involve any intervention by the user of this gem. Also, this gem will be installed as a result of installing another gem, so I don't want the user to have to keep up with changes to its dependent gem and have to modify the Gemfile manually. It would kind of be a violation of the Law of Demeter.
There is not a way that I know of to dynamically update the ruby version in the gem's gemspec file, however you can lock it to a specific ruby version:
spec.required_ruby_version = '>= 2.2.2'
Alternatively you could suggest to consumers of your gem (in the README perhaps) that they must force a specific version of nio4r if they are using versions of ruby older that 2.2.2.
In Gemfile for a new Ruby:
ruby "2.4.1"
gem "keiths_gem"
In a Gemfile with an old version of Ruby:
ruby "2.1.0"
gem "keiths_gem"
gem "nio4r", '1.2.1'

Two Ruby version in my environment?

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.

installing ruby-1.8.4 with rails 2.3.2 giving me error

I have a ruby on rails application, requirement for that app is as below.
ruby version must be ruby-1.8.4
rails 2.3.2
I have installed ruby-1.8.4 without rvm, and installed rubygems version "gem -v"( 1.3.1 ).
But the problem is that when i trying to run command
sudo gem install rails -v=2.3.2
it give me error like this
ERROR: Error installing rails:
rake requires Ruby version >= 1.8.6
Please suggest me how i can install rails 2.3.2 with ruby version 1.8.4
Beware, running such an antique version of ruby/rails has security and other implications. Ruby 1.8.4 is 7 years old, and Rails 2.3.2 is 3 and a half.
But anyway, you need to specifically install an older version of rake before trying to install rails; otherwise gem will just try to install the latest version of rake.
gem install rake -v=0.8.7
gem install rails -v=2.3.2
The problem is not in rails, it's in rake gem. Downgrade rake gem to earlier version - minimum required for rails 2.3.2.

Resources