https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292008-07-24T13:17:30ZRedmineRedmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=40562008-07-24T13:17:30ZThomas Lecavelier
<ul></ul><p>that's smell that you forgot to run<br /><pre>
rake db:migrate
</pre><br />on your database...</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=40572008-07-24T13:48:29ZA. Ni.
<ul></ul><p>OK, updated the databases (had to use this <a href="http://rubyresponse.wordpress.com/2006/07/22/cant-find-mysqldsock/" class="external">fix</a> though), but the error remains. Though the message is shorter:<br /><pre>
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:251:in `method_missing'
app/models/wiki_page.rb:111:in `editable_by?'
app/controllers/wiki_controller.rb:198:in `editable?'
app/controllers/wiki_controller.rb:51:in `index'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
</pre></p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=40582008-07-24T15:06:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Did you restart the app ?</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=40682008-07-24T17:40:11ZA. Ni.
<ul></ul><p>Yes, I did restart the app. Also, I installed another webserver (lighttpd) via<br /><pre>
ruby script/server -e production -d lighttpd
</pre><br />and tried to use the app with that. No change, still the error. It's a little bit odd because the wiki thing worked fine in v0.7.3 (rubygems 2.0.1) and before upgrading the database (comment <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: permissions if not admin (Closed)" href="https://www.redmine.org/issues/1">#1</a>) and before upgrading rubygems to 2.1.</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=40792008-07-26T08:58:18ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Please run the following and report the result:</p>
<pre>
$ ruby script/console production
Loading production environment (Rails 2.1.0)
>> WikiPage.column_names
=> ["id", "wiki_id", "title", "created_on", "protected"]
</pre> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=41002008-07-28T07:38:22ZA. Ni.
<ul></ul><p>It looks like the column <code>protected</code> is missing:<br /><pre>
ruby script/console production
Loading production environment (Rails 2.1.0)
>> WikiPage.column_names
=> ["id", "wiki_id", "title", "created_on"]
>> quit
</pre></p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=44722008-08-25T11:58:17ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Affected version (unused)</strong> deleted (<del><i>devel</i></del>)</li><li><strong>Resolution</strong> set to <i>Invalid</i></li></ul><p>Database was not migrated. Please run the migration script on the appropriate environment, just like it's mentioned here: <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineUpgrade">RedmineUpgrade</a>.<br />Eg.</p>
<pre><code>rake db:migrate RAILS_ENV="production"</code></pre> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=57192008-11-17T05:58:43ZTyler Z
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>I have had this happen twice now to applications of mine, where "rake db:migrate RAILS_ENV="production" does not do as expected.</p>
<p>Running console I get the following output:</p>
<p>Loading production environment (Rails 2.1.2)</p>
<blockquote><blockquote>
<p>WikiPage.column_names</p>
</blockquote></blockquote>
<p>=> ["id", "wiki_id", "title", "created_on", "parent_id"]</p>
<blockquote><blockquote>
</blockquote></blockquote>
<p>However, this is after running the migrate command as mentioned at the top and with the file "093_add_wiki_pages_protected.rb" in the "db/migrate/" path.</p>
<p>I manually added it last time, but why is it not migrating properly?</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=57202008-11-17T06:12:25ZTyler Z
<ul></ul><p>However, if I copy 093_add_wiki_pages_protected.rb to 102_add_my_wiki_pages_protected.rb changing the class to AddMyWikiPagesProtected, it works.</p>
<p>It did not work if I simply copied the file and assigned it a new filename, but it did work once I changed the filename and the class name as shown, not sure if the filename required the change because I did it first.</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=57242008-11-17T16:12:45ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Is there (or have you ever put) an other file in db/migrate that starts with 093_ ?</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=57372008-11-18T09:20:38ZTyler Z
<ul></ul><p>There is not currently, this is a fresh checkout (not an update) of the svn latest, however, I am using a database that I may have previously had my own 093_, when I manually added "parent_id" for wikis to 0.73 version. Is there something stored in the database that associates with the file?</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=57432008-11-18T17:08:36ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><blockquote>
<p>Is there something stored in the database that associates with the file?</p>
</blockquote>
<p>Yes, in this table: schema_migrations (see <a class="external" href="http://api.rubyonrails.org/classes/ActiveRecord/Migration.html">http://api.rubyonrails.org/classes/ActiveRecord/Migration.html</a>).<br />Redmine migration 93 was not executed because of yours.</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=69282009-01-26T19:31:04ZRandy Black
<ul><li><strong>File</strong> <a href="/attachments/1448">Picture_7.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1448/Picture_7.png">Picture_7.png</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>I have the same issue going on.</p>
<p>I have tried:</p>
<pre>
rake db:migrate db/migrate/093_add_wiki_pages_protected.rb RAILS_ENV="production"
</pre>
<p>and still get</p>
<pre>
Loading production environment (Rails 2.1.2)
>> WikiPage.column_names
=> ["id", "wiki_id", "title", "created_on"]
>>
</pre>
<p>which results in the following when I go to the wiki tab</p>
<pre>
Processing WikiController#index (for 216.9.187.117 at 2009-01-26 12:32:47) [GET]
Session ID: 49d5c4b1859173f00fd8f3d1cd5b106d
Parameters: {"action"=>"index", "id"=>"home", "controller"=>"wiki"}
NoMethodError (undefined method `protected?' for #<WikiPage:0x7f9a20b32b78>):
/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:251:in `method_missing'
/app/models/wiki_page.rb:112:in `editable_by?'
/app/controllers/wiki_controller.rb:209:in `editable?'
/app/controllers/wiki_controller.rb:63:in `edit'
/app/controllers/wiki_controller.rb:35:in `index'
/vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:579:in `call_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
/vendor/rails/railties/lib/fcgi_handler.rb:103:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:153:in `with_signal_handler'
/vendor/rails/railties/lib/fcgi_handler.rb:101:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:78:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request'
/vendor/rails/railties/lib/fcgi_handler.rb:76:in `catch'
/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request'
/vendor/rails/railties/lib/fcgi_handler.rb:50:in `process!'
/vendor/rails/railties/lib/fcgi_handler.rb:24:in `process!'
dispatch.fcgi:24
</pre>
<p>This is the error on the web</p>
<pre>
! Picture 7.png !
</pre><br />This is a pretty basic installation... Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=69332009-01-26T22:42:34ZRandy Black
<ul></ul><p>Could never get it to migrate successful, so in mysql I did:</p>
<pre>
ALTER TABLE wiki_pages ADD protected VARCHAR(60);
</pre> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=69372009-01-27T15:47:40ZRandy Black
<ul></ul><p>I had other issues with the index and date sorting as well.</p>
<pre>
It gave me NoMethodError (undefined method `parent_id' for #<WikiPage:0x7f22fe6d1348>):
</pre>
<p>so I</p>
<pre>
ALTER TABLE wiki_pages ADD parent_id VARCHAR(60);
</pre>
<p>I'm using bluehost and redmine v 0.8.0 , I'm not sure why the dbmigrate is not working.</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=69392009-01-27T17:45:02ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>So, I ask the question again:<br />Is there (or have you ever put) an other file in db/migrate that starts with 093_ or 095_ ?</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=113212009-10-09T02:32:43ZYann Autissier
<ul></ul><p>Hello,</p>
<p>I had the same problem when upgrading from v0.7.3 version to 0.8.4.</p>
<p>After successfully running the database migration process with :</p>
<pre>
rake db:migrate RAILS_ENV="production"
</pre>
<p>I got the following error in log/production.log when I tried to call the wiki :</p>
<pre>
NoMethodError (undefined method `protected?' for #<WikiPage:0x7f55c38a7080>):
</pre>
<p>The last migration script in v0.7.3 folder is :</p>
<pre>
$ ls db/migrate/093*
093_add_sessions.rb
</pre>
<p>Issuing the following mysql command, and restarting the app solved this issue :</p>
<pre>
mysql> ALTER TABLE wiki_pages ADD protected VARCHAR(60);
</pre>
<p>Thank you for your support,<br />Yann</p> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=132722009-12-26T12:16:56ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>Database</i></li></ul> Redmine - Defect #1681: NoMethodError in WikiController#indexhttps://www.redmine.org/issues/1681?journal_id=453382013-02-06T10:05:01ZDaniel Felix
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>I can't confirm this in the latest releases.</p>
<p>Regarding the old release, this seems to be closeable.<br />Please reopen if this issue still hits you.</p>