Search code examples
ruby-on-railsrubyrubygems

How do I know that a gem is compatible with a version of rails?


I'm just getting started with ruby on rails and as I follow the tutorial, there isn't an explanation of how certain gems were gathered and placed in the Gemfile. I've just been copying and pasting them and putting them in my Gemfile and running bundle install.

How does one go about downloading specific versions of gems, and their dependencies as well as making sure that they are compatible with the version of rails I'm using?


Solution

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