https://www.redmine.org/
https://www.redmine.org/favicon.ico?1679302129
2013-05-07T10:31:15Z
Redmine
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49197
2013-05-07T10:31:15Z
Peter Panther
<ul></ul><p>Have the same Issue with Version 2.3.1</p>
<p>Every runner-scripts produces warnings. The Apache log is is also flooded with these messages .....<br /><pre>
/var/lib/gems/1.8/gems/coderay-1.0.8/lib/coderay/helpers/file_type.rb:19: warning: already initialized constant UnknownFileType
/var/lib/gems/1.8/gems/coderay-1.0.8/lib/coderay/helpers/file_type.rb:126: warning: already initialized constant TypeFromExt
/var/lib/gems/1.8/gems/coderay-1.0.8/lib/coderay/helpers/file_type.rb:132: warning: already initialized constant TypeFromShebang
/var/lib/gems/1.8/gems/coderay-1.0.8/lib/coderay/helpers/file_type.rb:138: warning: already initialized constant TypeFromName
</pre></p>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49260
2013-05-08T15:03:57Z
Toshi MARUYAMA
<ul><li><strong>Subject</strong> changed from <i>Updating </i> to <i>warning: already initialized constant</i></li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49298
2013-05-10T01:43:08Z
xilong pei
<ul></ul><p>My redmine, <a class="external" href="http://elastos.org/project/">http://elastos.org/project/</a> has the same Issue.<br /><pre>
Environment:
Redmine version 2.0.3.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.6
Environment production
Database adapter MySQL
Redmine plugins:
no plugin installed
</pre></p>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49720
2013-05-28T16:32:52Z
Sen Haerens
<ul></ul><p>Same issue in 2.3.1</p>
<pre>
RAILS_ENV=production ./script/about
/usr/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:19: warning: already initialized constant UnknownFileType
/usr/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:126: warning: already initialized constant TypeFromExt
/usr/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:132: warning: already initialized constant TypeFromShebang
/usr/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:138: warning: already initialized constant TypeFromName
Environment:
Redmine version 2.3.1.stable.11903
Ruby version 1.8.7 (i686-linux)
Rails version 3.2.13
Environment production
Database adapter MySQL
Redmine plugins:
no plugin installed
</pre>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49726
2013-05-29T05:09:36Z
Toshi MARUYAMA
<ul><li><strong>Category</strong> set to <i>Ruby support</i></li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49804
2013-06-03T09:21:22Z
Nicolas Bouthors
<ul></ul><p>Hi all,</p>
<p>I had the same issue and I could fix it by commenting the line 36 <pre>require 'coderay/helpers/file_type'</pre> in <code>redmine/syntax_highlighting.rb</code>.</p>
<p>It seems to me that this combination of libs causes a include-loop (coderay auto loads syntax_highlighting).<br />Syntax highlight still works after ;)</p>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49834
2013-06-04T13:33:31Z
Toshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/11089">Defect #11089</a>: UTF-8 encoding not showing correctly when looking highlighted php file contents</i> added</li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49836
2013-06-04T13:35:37Z
Toshi MARUYAMA
<ul><li><strong>Related to</strong> deleted (<i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/11089">Defect #11089</a>: UTF-8 encoding not showing correctly when looking highlighted php file contents</i>)</li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49841
2013-06-04T14:00:18Z
Toshi MARUYAMA
<ul><li><strong>Subject</strong> changed from <i>warning: already initialized constant</i> to <i>warning: already initialized constant on Ruby 1.8.7</i></li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49842
2013-06-04T14:01:34Z
Toshi MARUYAMA
<ul><li><strong>Target version</strong> set to <i>2.4.0</i></li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49851
2013-06-05T04:02:50Z
Toshi MARUYAMA
<ul><li><strong>Target version</strong> changed from <i>2.4.0</i> to <i>2.3.2</i></li></ul>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=49854
2013-06-05T05:19:47Z
Toshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed in trunk <a class="changeset" title="prevent coderay "warning: already initialized constant" on Ruby 1.8.7 (#13692)" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11925">r11925</a> and 2.3-stable <a class="changeset" title="Merged r11925 from trunk to 2.3-stable (#13692) prevent coderay "warning: already initialized co..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11929">r11929</a>, thanks.</p>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=53013
2013-11-08T10:06:12Z
Bert Fraterman
<ul></ul><p>We're running ruby 2.0.0, but the fix in <a class="changeset" title="prevent coderay "warning: already initialized constant" on Ruby 1.8.7 (#13692)" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11925">r11925</a> causes a problem in displaying code files for us. We're getting a 500 error when trying to view file from the repository. Details:</p>
<pre>
Started GET "/projects/apps/repository/entry/trunk/code/Form1.cs" for 10.0.0.150 at 2013-11-08 10:41:35 +0100
Processing by RepositoriesController#entry as HTML
Parameters: {"id"=>"apps", "path"=>"trunk/code/Form1.cs"}
Current user: b.fraterman (id=11)
Rendered repositories/_navigation.html.erb (3.1ms)
Rendered repositories/_breadcrumbs.html.erb (1.9ms)
Rendered repositories/_link_to_functions.html.erb (2.2ms)
Rendered common/_file.html.erb (2.8ms)
Rendered repositories/entry.html.erb within layouts/base (11.3ms)
Completed 500 Internal Server Error in 175ms
ActionView::Template::Error (uninitialized constant CodeRay::FileType):
2: <table class="filecontent syntaxhl">
3: <tbody>
4: <% line_num = 1 %>
5: <% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>
6: <tr>
7: <th class="line-num" id="L<%= line_num %>">
8: <a href="#L<%= line_num %>"><%= line_num %></a>
lib/redmine/syntax_highlighting.rb:41:in `highlight_by_filename'
lib/redmine/syntax_highlighting.rb:23:in `highlight_by_filename'
app/helpers/application_helper.rb:394:in `syntax_highlight'
app/helpers/application_helper.rb:389:in `syntax_highlight_lines'
app/views/common/_file.html.erb:5:in `_app_views_common__file_html_erb___3771560638950630625_70345913460960'
app/views/repositories/entry.html.erb:11:in `_app_views_repositories_entry_html_erb___25072457751040657_70345912345220'
</pre>
<p>With <br /><pre>
require 'coderay/helpers/file_type'
</pre><br />everything works as expected.</p>
Redmine - Defect #13692: warning: already initialized constant on Ruby 1.8.7
https://www.redmine.org/issues/13692?journal_id=53220
2013-11-18T17:11:39Z
Toshi MARUYAMA
<ul></ul><p>Bert Fraterman wrote:</p>
<blockquote>
<p>We're running ruby 2.0.0, but the fix in <a class="changeset" title="prevent coderay "warning: already initialized constant" on Ruby 1.8.7 (#13692)" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11925">r11925</a> causes a problem in displaying code files for us. We're getting a 500 error when trying to view file from the repository. Details:</p>
<p>[...]</p>
<p>With <br />[...]<br />everything works as expected.</p>
</blockquote>
<p>I cannot reproduce on trunk <a class="changeset" title="Merged r12296 from trunk to 2.4-stable (#15376) Traditional Chinese translation updated by ChunC..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12297">r12297</a>.</p>
<pre>
Started GET "/projects/redmine-bb-all/repository/entry/app/models/attachment.rb" for 127.0.0.1 at 2013-11-19 02:06:50 +0900
Processing by RepositoriesController#entry as HTML
Parameters: {"id"=>"redmine-bb-all", "path"=>"app/models/attachment.rb"}
Current user: anonymous
Rendered repositories/_navigation.html.erb (424.2ms)
Rendered repositories/_breadcrumbs.html.erb (3.7ms)
Rendered repositories/_link_to_functions.html.erb (4.1ms)
Rendered common/_file.html.erb (214.1ms)
Rendered repositories/entry.html.erb within layouts/base (673.5ms)
Completed 200 OK in 1593.9ms (Views: 708.3ms | ActiveRecord: 5.8ms)
</pre>
<pre>
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
</pre>