How do you specify a minimum Ruby version in a gemspec?
From the RubyGems documentation:
# This gem will work with 1.8.6 or greater...
spec.required_ruby_version = '>= 1.8.6'
# Only with ruby 2.0.x
spec.required_ruby_version = '~> 2.0'
How do I know that a gem is compatible with a version of rails?
For rails 4 and 5 you can check here. If gem ready or not.
Rails automatically install best suited newest version of gem when you run bundle install if you write gem 'gemname'
. Specifying a gem version is mention in other answers.
If a specific version of ruby or rails or any dependency is required in a gem. Then it is specified in gemspec file of gem and Gemfile for that gem.
You can cross-check in gemspec or Gemfile of gem also if something break while bundle install.
Can I install ruby gems for a specific ruby version?
The issue is not ActiveSupport, it's the Ruby version. What version of Ruby are you running? You should probably be using 2.0 or later.
Does Bundler Gem take in consideration your Ruby environment?
It depends! Bundler relies on the configuration of the Gemspecs that each Gem provides.
Gemspecs offer the posibility to provide different or additional dependencies based on the runtime environment. IE you can change the dependencies for JRuby or provide different binaries for i386 architectures.
As far as i know, it's not possible to declare a gem as 1.9 or 1.8 compatible (which would have made sense to me). I think it's partly so, because 1.9 is 99% downward compatible.
You are always forced to have a look at the gems themselves. Because of this, there are sites like http://isitruby19.com/
As you might see, it's not an issue of Bundler, but RubyGems.
Related Topics
Best Practice for Limiting the Number of Associations Within a Has_Many Relationship
Ruby (With Rails) Convert a String of Time into Seconds
Invoking Knife in a Ruby Class
Thin Doesn't Respond to Sigint or Sigterm
Rails Include Only Selected Columns from Relation
Retrieve All Posts Where the Given User Has Commented, Ruby on Rails
Why Are My Thread Variables Intermittent in Rails
Jekyll Templates Using Django-Like Liquid Blocks/Inheritance
Escaping the .Each { } Iteration Early in Ruby
How to Read from Redis Inside a Multi Block in Ruby
Using %I and %I Symbol Array Literal
Coping with "String Contains Null Byte" Sent from Users
Carrierwave Cannot Remove Image
Count Records Created Within the Last 7 Days
What Do I Need to Do to Get Hash.From_Xml() to Work