weppos/tabs_on_rails

undefined method `tabs_tag' with 1.3.2 and 2.0.0.pre

incubus opened this issue · 9 comments

Hi!

I got a "undefined method `tabs_tag'" error with 1.3.2 and 2.0.0.pre versions. With 1.3.1 everything is ok.

$ rails -v

Rails 3.0.3

$ ruby -v

ruby 1.9.2p0 (2010-08-18 revision 29036) [amd64-freebsd9]

$ cat Gemfile

source 'http://rubygems.org'

gem 'rails', '3.0.3'

gem 'active_scaffold'
gem 'ancestry'
gem 'devise'
gem 'haml'
gem 'pg'
gem 'tabs_on_rails'

This is strange. There's no change between releases 1.3.1 and 1.3.2 that justify that error.
v1.3.1...v1.3.2

Could you please post the backtrace?

Hi!

undefined method `tabs_tag' for #<#Class:0x00000806413ad0:0x000008064113c0>

Extracted source (around line #10):

7: = active_scaffold_includes
8: = csrf_meta_tag
9: %body
10: = tabs_tag :open_tabs => { :id => 'tabs' } do |tab|
11: = tab.translations t('menu.translations'), translations_path
12: = tab.plugins t('menu.plugins'), plugins_path
13: = tab.categories t('menu.categories'), categories_path

Here is the "Full trace":

app/views/layouts/application.html.haml:10:in _app_views_layouts_application_html_haml__1253120005248184980_17232325600__2929672143226869230' actionpack (3.0.3) lib/action_view/template.rb:135:inblock in render'
activesupport (3.0.3) lib/active_support/notifications.rb:54:in instrument' actionpack (3.0.3) lib/action_view/template.rb:127:inrender'
actionpack (3.0.3) lib/action_view/render/layouts.rb:80:in _render_layout' actionpack (3.0.3) lib/action_view/render/rendering.rb:62:inblock in _render_template'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in block in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:ininstrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in_render_template'
actionpack (3.0.3) lib/action_view/render/rendering.rb:26:in render' active_scaffold (3.0.5) lib/extensions/action_view_rendering.rb:86:inrender_with_active_scaffold'
haml (3.0.24) lib/haml/helpers/action_view_mods.rb:13:in render_with_haml' actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:in_render_template'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:108:in render_to_body' actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:inrender_to_body'
actionpack (3.0.3) lib/action_controller/metal/compatibility.rb:55:in render_to_body' actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:inrender_to_string'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:in render' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:inrender'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in block (2 levels) in render' activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:inblock in ms'
/usr/local/lib/ruby/1.9/benchmark.rb:309:in realtime' activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:inms'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in block in render' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:incleanup_view_runtime'
activerecord (3.0.3) lib/active_record/railties/controller_runtime.rb:15:in cleanup_view_runtime' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:inrender'
active_scaffold (3.0.5) lib/extensions/action_controller_rendering.rb:13:in render_with_active_scaffold' active_scaffold (3.0.5) lib/active_scaffold/actions/list.rb:30:inlist_respond_to_html'
active_scaffold (3.0.5) lib/active_scaffold/actions/core.rb:134:in block (3 levels) in respond_to_action' actionpack (3.0.3) lib/action_controller/metal/mime_responds.rb:192:incall'
actionpack (3.0.3) lib/action_controller/metal/mime_responds.rb:192:in respond_to' active_scaffold (3.0.5) lib/active_scaffold/actions/core.rb:132:inrespond_to_action'
active_scaffold (3.0.5) lib/active_scaffold/actions/list.rb:22:in list' active_scaffold (3.0.5) lib/active_scaffold/actions/list.rb:9:inindex'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (3.0.3) lib/abstract_controller/base.rb:151:inprocess_action'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in process_action' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:inblock in process_action'
activesupport (3.0.3) lib/active_support/callbacks.rb:480:in _run__3702472036361167872__process_action__1218955669023085351__callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:409:in_run_process_action_callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in run_callbacks' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:inprocess_action'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in block in process_action' activesupport (3.0.3) lib/active_support/notifications.rb:52:inblock in instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in process_action' actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:inprocess_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in process' actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:inprocess'
actionpack (3.0.3) lib/action_controller/metal.rb:138:in dispatch' actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.0.3) lib/action_controller/metal.rb:178:in block in action' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:incall'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in dispatch' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:incall'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in block in call' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:inblock in recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:68:in optimized_each' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:inrecognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in call' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:incall'
haml (3.0.24) lib/sass/plugin/rack.rb:41:in call' warden (1.0.3) lib/warden/manager.rb:35:inblock in call'
warden (1.0.3) lib/warden/manager.rb:34:in catch' warden (1.0.3) lib/warden/manager.rb:34:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:incall'
rack (1.2.1) lib/rack/methodoverride.rb:24:in call' actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in call' actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in call' activerecord (3.0.3) lib/active_record/query_cache.rb:32:inblock in call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in cache' activerecord (3.0.3) lib/active_record/query_cache.rb:12:incache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in call' activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in block in call' activesupport (3.0.3) lib/active_support/callbacks.rb:415:in_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in call' rack (1.2.1) lib/rack/sendfile.rb:107:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in call' actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:incall'
railties (3.0.3) lib/rails/rack/logger.rb:13:in call' rack (1.2.1) lib/rack/runtime.rb:17:incall'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.2.1) lib/rack/lock.rb:11:inblock in call'
internal:prelude:10:in synchronize' rack (1.2.1) lib/rack/lock.rb:11:incall'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in call' railties (3.0.3) lib/rails/application.rb:168:incall'
railties (3.0.3) lib/rails/application.rb:77:in method_missing' railties (3.0.3) lib/rails/rack/log_tailer.rb:14:incall'
rack (1.2.1) lib/rack/content_length.rb:13:in call' rack (1.2.1) lib/rack/handler/webrick.rb:52:inservice'
/usr/local/lib/ruby/1.9/webrick/httpserver.rb:111:in service' /usr/local/lib/ruby/1.9/webrick/httpserver.rb:70:inrun'
/usr/local/lib/ruby/1.9/webrick/server.rb:183:in `block in start_thread'

I'm sorry but I can't reproduce the error. Is the plugin loaded? Please use 2.x with Rails 3.

Hi! Yes, it's very strange. Here is the test app: https://github.com/IncubuS/tabs_on_rails_test

[incubus@incubus workspace/tabs_on_rails_test]$ rails s
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-02-03 17:19:18] INFO WEBrick 1.3.1
[2011-02-03 17:19:18] INFO ruby 1.9.2 (2010-08-18) [amd64-freebsd9]
[2011-02-03 17:19:18] INFO WEBrick::HTTPServer#start: pid=15114 port=3000

Started GET "/" for 127.0.0.1 at 2011-02-03 17:19:24 +0800
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.erb within layouts/application (34.5ms)
Completed in 40ms

ActionView::Template::Error (undefined method tabs_tag' for #<#<Class:0x00000804156d80>:0x000008041544b8>): 1: <%= tabs_tag do |tab| %> 2: <% end %> app/views/welcome/index.html.erb:1:in_app_views_welcome_index_html_erb__4461407911280561611_17214116580__1522208961158799882'

Rendered /usr/local/lib/ruby/gems/1.9/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
Rendered /usr/local/lib/ruby/gems/1.9/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.5ms)
Rendered /usr/local/lib/ruby/gems/1.9/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (11.6ms)

Hi!

I found the problem:

[incubus@incubus tabs_on_rails-2.0.0.pre/lib]$ pwd
/usr/local/lib/ruby/gems/1.9/gems/tabs_on_rails-2.0.0.pre/lib

[incubus@incubus tabs_on_rails-2.0.0.pre/lib]$ ls -l
total 4
drwxr-xr-x 3 root wheel 512 Feb 3 16:09 tabs_on_rails
-rw------- 1 root wheel 470 Feb 3 16:09 tabs_on_rails.rb
^^
[incubus@incubus lib/tabs_on_rails]$ pwd
/usr/local/lib/ruby/gems/1.9/gems/tabs_on_rails-2.0.0.pre/lib/tabs_on_rails

[incubus@incubus lib/tabs_on_rails]$ ls -l
total 16
-rw------- 1 root wheel 6838 Feb 3 16:09 action_controller.rb
^^
-rw------- 1 root wheel 875 Feb 3 16:09 railtie.rb
^^
drwxr-xr-x 2 root wheel 512 Feb 3 16:09 tabs
-rw-r--r-- 1 root wheel 1732 Feb 3 16:09 tabs.rb
-rw-r--r-- 1 root wheel 512 Feb 3 16:09 version.rb

Wrong permissions! With tabs.rb and version.rb files everything is ok.

Gulp!

I just fixed the permissions and published the release 2.0.0.pre2.
Could you please try it and confirm it works?

Yes, it works! Thanks!

Thank you very much IncubuS, your help has been essential to debug and solve the issue.

Hi,

I'm getting the same error. I have the following installed:-

Ruby: ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
Rails: 3.0.5
tabs_on_rails: 2.0.1

I'm running on Windows XP SP3. I checked the permissions on the gem files and it appears I have RW permissions on everything. I'm a newbie to rails so I didn't fully understand the fix stated above. Sorry.

UPDATE: OK, I removed the "readonly" tag on the directories and allowed it to propagate to the subdirectories and files. This appears to have fixed the problem. Unfortunately I don't know the exact cause but at least whatever I did was a simple fix.