The Ruby on Rails Tutorial <https://www.railstutorial.org/book/frontmatter> 
by Michael Hartl uses a Gemfile without specifying a Ruby version: the ruby 
keyword is missing in all the applications.

When I deploy to Heroku I receive the following warning:


remote: ###### WARNING:
remote:        You have not declared a Ruby version in your Gemfile.
remote:        To set your Ruby version add this line to your Gemfile:
remote:        ruby '2.2.4'
remote:        # See https://devcenter.heroku.com/articles/ruby-versions for 
more information.

The tutorial says 
<https://www.railstutorial.org/book/sign_up#sec-ruby_version_number> that "*the 
costs associated with including such an explicit Ruby version number 
outweigh the (negligible) benefits, so you should ignore this warning for 
now. The main issue is that keeping your sample app and system in sync with 
the latest Ruby version can be a huge inconvenience*".


I am wondering what is better (if I can choose), between using the same 
Ruby version at Heroku and specifying any Ruby version it suits me. Since I 
am using Ruby 2.2.1p85 for my application, adding ruby "2.2.1", :patchlevel 
=> "85" would work and make Heroku adjust to this version or rather I am 
supposed to adjust to Heroku and add as suggested ruby '2.2.4'? Can I leave 
out the Ruby version with no worries?


I am using rvm and a specific gemset with a specific Ruby version, for no 
other reason than trying to use an environment as much close to the 
tutorial as possible.

How can I decide what Ruby version and what version of the gems in the 
Gemfile are suitable for my application?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/14038cb1-651e-45ec-be31-787f248a082f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to