Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `new' for "Rack::Bug":String> #19

Open
jarl-dk opened this issue Jul 8, 2010 · 7 comments
Open

undefined method `new' for "Rack::Bug":String> #19

jarl-dk opened this issue Jul 8, 2010 · 7 comments

Comments

@jarl-dk
Copy link

jarl-dk commented Jul 8, 2010

I have installed the gem

I have added the line
config.middleware.use "Rack::Bug", :secret_key => "adsfl232343sdfs24759uweafsdfsd5234"
to my environments/development.rb

I can start the server, but when I hit my application by pointing my browser to
http://localhost:3000/**rack_bug**/bookmarklet.html
I get the error:
hermes157~/projects/inseeto/pegasus-performance:./script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Thu Jul 08 13:44:49 +0200 2010: Read error: #<NoMethodError: undefined method new' for "Rack::Bug":String> /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:72:in build'
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:inbuild' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in inject'
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:ineach' /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in inject'
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:inbuild' /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in build_middleware_stack'
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:113:incall' /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in run'
/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:incall' /var/lib/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in call'
/var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:incall' /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in each'
/var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:incall' /var/lib/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in call'
/var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:incall' /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in call'
/var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:inprocess' /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:ineach' /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun' /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:innew' /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:ininitialize' /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:inrun' /var/lib/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in run'
/var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require'
./script/server:3

Jarl

@josevalim
Copy link

Have you tried giving Rack::Bug as constant instead of string?

@jarl-dk
Copy link
Author

jarl-dk commented Jul 9, 2010

No. I just followed the guide: http://github.com/brynary/rack-bug. I'll try it soon.

@jarl-dk
Copy link
Author

jarl-dk commented Jul 9, 2010

Now I have tried
config.middleware.use Rack::Bug, :secret_key => "adsfl232343sdfs24759uweafsdfsd5234"
as well, but now it won't even start my server. it says
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in load_missing_constant': uninitialized constant Rails::Rack::Bug (NameError) from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:inconst_missing'
from /home/jarl/projects/inseeto/pegasus-test_refactor/config/environments/development.rb:58:in load_environment' from /var/lib/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:386:inload_environment'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in silence_warnings' from /var/lib/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:379:inload_environment'
from /var/lib/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:137:in process' from /var/lib/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:insend'
from /var/lib/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in run' from /home/jarl/projects/inseeto/pegasus-test_refactor/config/environment.rb:14 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from ./script/server:3

@josevalim
Copy link

Oh, try ::Rack::Bug instead of Rack::Bug.

@jarl-dk
Copy link
Author

jarl-dk commented Jul 9, 2010

Done. Same problem, server wont start with ST as above.

@mattetti
Copy link

require 'rack/bug'
config.middleware.use ::Rack::Bug, :secret_key => "adsfl232343sdfs24759uweafsdfsd5234"

@paulbjensen
Copy link

Guys, I'm not having any luck getting this running (Rails 3.0.9 on Ruby 1.9.2):

ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `render_template' for class `ActionView::Template' (NameError)
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel/actionview_extension.rb:10:in `block in <top (required)>'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel/actionview_extension.rb:2:in `class_eval'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel/actionview_extension.rb:2:in `<top (required)>'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `block in require'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `block in load_dependency'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel.rb:5:in `<class:TemplatesPanel>'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel.rb:4:in `<module:Bug>'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel.rb:2:in `<module:Rack>'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/panels/templates_panel.rb:1:in `<top (required)>'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/options.rb:80:in `initialize_options'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug/toolbar.rb:29:in `initialize'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug.rb:43:in `new'
ruby-1.9.2-p290/gems/rack-bug-0.3.0/lib/rack/bug.rb:43:in `new'

Napolskih pushed a commit to Napolskih/rack-bug that referenced this issue May 12, 2014
Make ActiveRecord work again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants