diff --git a/source/guides/gemfile_ruby.html.haml b/source/guides/gemfile_ruby.html.haml deleted file mode 100644 index 8bd4e0e6f2..0000000000 --- a/source/guides/gemfile_ruby.html.haml +++ /dev/null @@ -1,59 +0,0 @@ -.container.guide - %h2 Specifying a Ruby Version - - .contents - .bullet - .description - Like gems, developers can setup a dependency on Ruby. - This makes your app fail faster in case you depend on specific features in a Ruby VM. - This way, the Ruby VM on your deployment server will match your local one. You can do this by using the ruby directive in the Gemfile: - :code - # lang: ruby - ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION', - :patchlevel => 'RUBY_PATCHLEVEL' - - .bullet - .description - If you wanted to use JRuby 1.6.7 using Ruby 1.9.3, you would simply do the following: - :code - # lang: ruby - ruby '1.9.3', :engine => 'jruby', :engine_version => '1.6.7' - - .bullet#patchlevel - .description - It's also possible to restrict the patchlevel of the Ruby used by doing the following: - :code - # lang: ruby - ruby '1.9.3', :patchlevel => '448' - - .bullet - .description - Bundler will make checks against the current running Ruby VM to make sure it matches what is specified in the Gemfile. If things don't match, Bundler will raise an Exception explaining what doesn't match. - :code - Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3 - - .bullet - .description - Both :engine and :engine_version are optional. - When these options are omitted, this means the app is compatible with a particular Ruby ABI but the engine is irrelevant. - When :engine is used, :engine_version must also be specified. - .bullet - .description - Using the platform command with the --ruby flag, you can see what ruby directive is specified in the Gemfile. - :code - ruby 1.9.3 (jruby 1.6.7) - = link_to 'Learn More: bundle platform', '/man/bundle-platform.1.html', class: 'btn btn-primary' - - .bullet - .description - In the ruby directive, :patchlevel is optional, as patchlevel releases are usually compatible and include important security fixes. - The patchlevel option checks the RUBY_PATCHLEVEL constant, and if not specified then bundler will simply ignore it. - - .bullet - .description - Version operators for specifying a Ruby version are also available. - The set of supported version operators is that of Rubygems (gem version operators). (ie. <, >, <=, >=, ~>, =) - :code - # lang: ruby - ruby '~> 2.3.0' - = link_to 'Learn More: Version Operators', 'https://guides.rubygems.org/patterns/#declaring-dependencies', class: 'btn btn-primary' diff --git a/source/guides/gemfile_ruby.html.md b/source/guides/gemfile_ruby.html.md new file mode 100644 index 0000000000..37d9c6e4c8 --- /dev/null +++ b/source/guides/gemfile_ruby.html.md @@ -0,0 +1,50 @@ +## Specifying a Ruby Version + +Like gems, developers can setup a dependency on Ruby. +This makes your app fail faster in case you depend on specific features in a Ruby VM. +This way, the Ruby VM on your deployment server will match your local one. You can do this by using the `ruby` directive in the `Gemfile`: + +~~~ruby +ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION', +:patchlevel => 'RUBY_PATCHLEVEL' +~~~ + +If you wanted to use JRuby 1.6.7 using Ruby 1.9.3, you would simply do the following: + +~~~ruby +ruby '1.9.3', :engine => 'jruby', :engine_version => '1.6.7' +~~~ + +It's also possible to restrict the patchlevel of the Ruby used by doing the following: + +~~~ruby +ruby '1.9.3', :patchlevel => '448' +~~~ + +Bundler will make checks against the current running Ruby VM to make sure it matches what is specified in the `Gemfile`. If things don't match, Bundler will raise an Exception explaining what doesn't match. + +~~~ +Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3 +~~~ + +Both `:engine` and `:engine_version` are optional. +When these options are omitted, this means the app is compatible with a particular Ruby ABI but the engine is irrelevant. +When `:engine` is used, `:engine_version` must also be specified. +Using the `platform` command with the `--ruby` flag, you can see what `ruby` directive is specified in the `Gemfile`. + +~~~ +ruby 1.9.3 (jruby 1.6.7) +~~~ + +Learn More: bundle platform + +In the `ruby` directive, `:patchlevel` is optional, as patchlevel releases are usually compatible and include important security fixes. +The patchlevel option checks the `RUBY_PATCHLEVEL` constant, and if not specified then bundler will simply ignore it. +Version operators for specifying a Ruby version are also available. +The set of supported version operators is that of Rubygems (`gem` version operators). (ie. `<`, `>`, `<=`, `>=`, `~>`, `=`) + +~~~ruby +ruby '~> 2.3.0' +~~~ + +Learn More: Version Operators