https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292020-01-12T05:29:26ZRedmineRedmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=956412020-01-12T05:29:26ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/32787">Patch #32787</a>: Redmine 4.0 no longer supports Ruby 2.2</i> added</li></ul> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=956512020-01-12T09:02:42ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>A probably better option would be to set this as a dependency in the Gemfile: <a class="external" href="https://bundler.io/v1.12/gemfile_ruby.html">https://bundler.io/v1.12/gemfile_ruby.html</a><br />That would ensure that a compatible ruby version is used.<br />What do you think?</p> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=956522020-01-12T09:17:44ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>A probably better option would be to set this as a dependency in the Gemfile: <a class="external" href="https://bundler.io/v1.12/gemfile_ruby.html">https://bundler.io/v1.12/gemfile_ruby.html</a><br />That would ensure that a compatible ruby version is used.<br />What do you think?</p>
</blockquote>
<p>I’m in favor of this option.</p> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=956802020-01-13T00:35:56ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/24598">specify-ruby-version-in-gemfile.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24598/specify-ruby-version-in-gemfile.patch">specify-ruby-version-in-gemfile.patch</a> added</li><li><strong>Subject</strong> changed from <i>List all supported Ruby versions in doc/INSTALL</i> to <i>Specify supported Ruby version in Gemfile</i></li><li><strong>Category</strong> changed from <i>Documentation</i> to <i>Ruby support</i></li></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>A probably better option would be to set this as a dependency in the Gemfile: <a class="external" href="https://bundler.io/v1.12/gemfile_ruby.html">https://bundler.io/v1.12/gemfile_ruby.html</a><br />That would ensure that a compatible ruby version is used.<br />What do you think?</p>
</blockquote>
<p>It is a more sophisticated way than simply describing in the document. I didn't know the feature of Bundler. Thank you for the advice.</p>
<p>The attached is a new patch that updates both Gemfile and doc/INSTALL.</p> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=957132020-01-14T00:43:46ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>Specify supported Ruby version in Gemfile</i> to <i>Specify supported Ruby version in Gemfile and doc/INSTALL</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li></ul><p>Committed the patch.</p> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=958452020-01-25T02:36:58ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/32841">Patch #32841</a>: Drop support for Bundler prior to 1.12.0</i> added</li></ul> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=958472020-01-25T05:21:45ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>The <code>ruby</code> directive in Gemfile is supported by <code>bundler</code> 1.12.0 or later. So, <a class="changeset" title="Specify supported Ruby version in Gemfile and doc/INSTALL (#32788)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/19425">r19425</a> causes the following error when a user runs <code>bundle install</code> if the version of bundler is prior to 1.12.0.</p>
<pre>
$ bundle -v
Bundler version 1.11.2
$ bundle install
[!] There was an error parsing `Gemfile`: no implicit conversion of Symbol into Integer. Bundler cannot continue.
# from /Users/maeda/redmines/trunk/Gemfile:3
# -------------------------------------------
#
> ruby '>= 2.3.0', '< 2.7.0'
# gem "bundler", ">= 1.5.0"
# -------------------------------------------
</pre>
<p>You can avoid the error by skipping the <code>ruby</code> directive with the following patch. The version of Ruby is not checked if you run an older version of Bundler that does not support <code>ruby</code> directive.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/Gemfile b/Gemfile
index 78db5caf8..bcc58ee35 100644
</span><span class="gd">--- a/Gemfile
</span><span class="gi">+++ b/Gemfile
</span><span class="p">@@ -1,6 +1,6 @@</span>
source 'https://rubygems.org'
-ruby '>= 2.3.0', '< 2.7.0'
<span class="gi">+ruby '>= 2.3.0', '< 2.7.0' if Bundler::VERSION >= '1.12.0'
</span> gem "bundler", ">= 1.5.0"
gem "rails", "5.2.4.1"
</code></pre> Redmine - Patch #32788: Specify supported Ruby version in Gemfile and doc/INSTALLhttps://www.redmine.org/issues/32788?journal_id=958612020-01-26T01:17:04ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Committed the fix described in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Specify supported Ruby version in Gemfile and doc/INSTALL (Closed)" href="https://www.redmine.org/issues/32788#note-7">#32788#note-7</a>.</p>