uninitialized constant Wicked::Wizard #3

Closed
JakeAustwick opened this Issue Mar 15, 2012 · 15 comments

Comments

Projects
None yet
8 participants
@JakeAustwick

Getting the following error when using a namespaced controller.

uninitialized constant Wicked::Wizard

The following makes no difference either:
::Wicked::Wizard

@schneems schneems closed this in bde8396 Mar 15, 2012

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 15, 2012

Owner

Try 0.1.1 and see if you have the same problem

Owner

schneems commented Mar 15, 2012

Try 0.1.1 and see if you have the same problem

@plagi

This comment has been minimized.

Show comment
Hide comment
@plagi

plagi Mar 17, 2012

thanks, it's working :)

plagi commented Mar 17, 2012

thanks, it's working :)

@JakeAustwick

This comment has been minimized.

Show comment
Hide comment
@JakeAustwick

JakeAustwick Mar 18, 2012

Fixed, can close this issue.

Fixed, can close this issue.

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 18, 2012

Owner

Woot! Thanks for trying it out!

Owner

schneems commented Mar 18, 2012

Woot! Thanks for trying it out!

@Mawaheb

This comment has been minimized.

Show comment
Hide comment
@Mawaheb

Mawaheb Nov 22, 2013

I am facing the same problem, tried version '0.1.1' and '0.1.0' with no luck .

Mawaheb commented Nov 22, 2013

I am facing the same problem, tried version '0.1.1' and '0.1.0' with no luck .

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Nov 22, 2013

Owner

What do you get when you run bundle show wicked ? Do you maybe have require: false in your Gemfile?

Owner

schneems commented Nov 22, 2013

What do you get when you run bundle show wicked ? Do you maybe have require: false in your Gemfile?

@Mawaheb

This comment has been minimized.

Show comment
Hide comment
@Mawaheb

Mawaheb Nov 22, 2013

I get :
/home/mawaheb/.rvm/gems/ruby-1.9.3-p392/gems/wicked-0.1.0

P.S, I am actually trying in include it in my mountable gem... i even tried ::Wicked::Wizard did not work.
I tried to inherit from Wicked::WizardController but then i started getting :
"Undifined action 'show' "

Mawaheb commented Nov 22, 2013

I get :
/home/mawaheb/.rvm/gems/ruby-1.9.3-p392/gems/wicked-0.1.0

P.S, I am actually trying in include it in my mountable gem... i even tried ::Wicked::Wizard did not work.
I tried to inherit from Wicked::WizardController but then i started getting :
"Undifined action 'show' "

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Nov 22, 2013

Owner

You need to use the latest which is 1.0.2 there is a serious security vulnerability in anything under 1.0.1.

In your Gem you need to make sure to require 'wicked' before you need to use it. It is better to include as a module than inherit. This gem also expects the existance of an ApplicationController which may or may not be present in your system.

Owner

schneems commented Nov 22, 2013

You need to use the latest which is 1.0.2 there is a serious security vulnerability in anything under 1.0.1.

In your Gem you need to make sure to require 'wicked' before you need to use it. It is better to include as a module than inherit. This gem also expects the existance of an ApplicationController which may or may not be present in your system.

@pbraswell

This comment has been minimized.

Show comment
Hide comment
@pbraswell

pbraswell Mar 6, 2014

So I've run into this issue also. I'm using Rails 4.0.2. I've tried gem 'wicked', require: true with no luck. "bundle show wicked" gives:

/Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2

Any idea what might be wrong?

So I've run into this issue also. I'm using Rails 4.0.2. I've tried gem 'wicked', require: true with no luck. "bundle show wicked" gives:

/Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2

Any idea what might be wrong?

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 6, 2014

Owner

weird

$ echo "gem 'wicked'" >> Gemfile
2.1.1  ~/documents/projects/codetriage (master)
$ bundle install
Your Gemfile lists the gem wicked (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Using i18n (0.6.9)
Using rake (10.1.1)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using builder (3.1.4)
Using tzinfo (0.3.38)
Using erubis (2.7.0)
Using rack (1.5.2)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.2)
Using addressable (2.3.5)
Using bcrypt-ruby (3.1.1)
Using bluecloth (2.2.0)
Using mini_portile (0.5.1)
Using coffee-script-source (1.6.3)
Using thor (0.18.1)
Using commonjs (0.2.6)
Using safe_yaml (0.9.4)
Using dalli (2.6.4)
Using orm_adapter (0.4.0)
Using dotenv (0.8.0)
Using eventmachine (1.0.3)
Using excon (0.25.3)
Using multipart-post (1.2.0)
Using get_process_mem (0.0.2)
Using rrrretry (0.0.1)
Using hashie (2.0.5)
Using hike (1.2.3)
Using http_parser.rb (0.5.3)
Using multi_xml (0.5.4)
Using httpauth (0.2.0)
Using kgio (2.8.0)
Using kramdown (1.1.0)
Using tilt (1.4.1)
Using bundler (1.5.3)
Using metaclass (0.0.1)
Using mono_logger (1.1.0)
Using pg (0.16.0)
Using rack-timeout (0.0.4)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.1)
Using raindrops (0.11.0)
Using redis (3.0.4)
Using sass (3.2.10)
Using shoulda-context (1.1.4)
Using simplecov-html (0.7.1)
Using vcr (2.5.0)
Using will_paginate (3.0.4)
Using thread_safe (0.1.3)
Using execjs (1.4.0)
Using jwt (0.1.8)
Using rack-test (0.6.2)
Using warden (1.2.3)
Using puma (2.7.1)
Using rack-protection (1.5.0)
Using vegas (0.1.11)
Using treetop (1.4.15)
Using launchy (2.3.0)
Using nokogiri (1.6.0)
Using less (2.3.2)
Using crack (0.4.1)
Using dotenv-rails (0.8.0)
Using foreman (0.63.0)
Using faye-websocket (0.4.7)
Using faraday (0.8.8)
Using git_hub_bub (0.0.2)
Using omniauth (1.1.4)
Using httparty (0.11.0)
Using mail_view (1.0.3)
Using sprockets (2.10.1)
Using mocha (0.14.0)
Using rails_12factor (0.0.2)
Using unicorn (4.6.3)
Using redis-namespace (1.3.0)
Using simplecov (0.7.1)
Using activesupport (4.0.3)
Using coffee-script (2.2.0)
Using uglifier (2.1.2)
Using sinatra (1.4.3)
Using mail (2.5.4)
Using xpath (2.0.0)
Using webmock (1.13.0)
Using oauth2 (0.8.1)
Using actionpack (4.0.3)
Using activemodel (4.0.3)
Using shoulda-matchers (2.2.0)
Using skylight (0.1.8)
Using resque (1.24.1)
Using capybara (2.1.0)
Using omniauth-oauth2 (1.1.1)
Using actionmailer (4.0.3)
Using railties (4.0.3)
Using less-rails (2.3.3)
Using sprockets-rails (2.0.1)
Using activerecord (4.0.3)
Using shoulda (3.5.0)
Using resque_def (0.0.3)
Using poltergeist (1.3.0)
Using omniauth-github (1.1.1)
Using coffee-rails (4.0.0)
Using devise (3.0.1)
Using jquery-rails (3.0.4)
Using quiet_assets (1.0.2)
Using sass-rails (4.0.0)
Using sprockets_better_errors (0.0.4)
Using rails (4.0.3)
Using phantomjs (1.8.1.1)
Using maildown (1.0.1)
Using rails_autolink (1.1.0)
Using wicked (1.0.0)
Using teaspoon (0.7.4)
Using puma_auto_tune (0.0.1) from git://github.com/schneems/puma_auto_tune.git (at master)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
2.1.1  ~/documents/projects/codetriage (master)
$ rails c
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:2: warning: already initialized constant GitHubBub::Request::USER_AGENT
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:7: warning: previous definition of USER_AGENT was here
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:3: warning: already initialized constant GitHubBub::Request::RETRIES
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:12: warning: previous definition of RETRIES was here
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:4: warning: already initialized constant GitHubBub::Request::GITHUB_VERSION
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:8: warning: previous definition of GITHUB_VERSION was here
Loading development environment (Rails 4.0.3)
irb(main):001:0> Wicked::Wizard
=> Wicked::Wizard

What happens when you

$ irb
> require 'rubygems'
> require 'wicked'

??? What version of bundler are you using? Can you try upgrading to the latest?

Owner

schneems commented Mar 6, 2014

weird

$ echo "gem 'wicked'" >> Gemfile
2.1.1  ~/documents/projects/codetriage (master)
$ bundle install
Your Gemfile lists the gem wicked (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Using i18n (0.6.9)
Using rake (10.1.1)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using builder (3.1.4)
Using tzinfo (0.3.38)
Using erubis (2.7.0)
Using rack (1.5.2)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.2)
Using addressable (2.3.5)
Using bcrypt-ruby (3.1.1)
Using bluecloth (2.2.0)
Using mini_portile (0.5.1)
Using coffee-script-source (1.6.3)
Using thor (0.18.1)
Using commonjs (0.2.6)
Using safe_yaml (0.9.4)
Using dalli (2.6.4)
Using orm_adapter (0.4.0)
Using dotenv (0.8.0)
Using eventmachine (1.0.3)
Using excon (0.25.3)
Using multipart-post (1.2.0)
Using get_process_mem (0.0.2)
Using rrrretry (0.0.1)
Using hashie (2.0.5)
Using hike (1.2.3)
Using http_parser.rb (0.5.3)
Using multi_xml (0.5.4)
Using httpauth (0.2.0)
Using kgio (2.8.0)
Using kramdown (1.1.0)
Using tilt (1.4.1)
Using bundler (1.5.3)
Using metaclass (0.0.1)
Using mono_logger (1.1.0)
Using pg (0.16.0)
Using rack-timeout (0.0.4)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.1)
Using raindrops (0.11.0)
Using redis (3.0.4)
Using sass (3.2.10)
Using shoulda-context (1.1.4)
Using simplecov-html (0.7.1)
Using vcr (2.5.0)
Using will_paginate (3.0.4)
Using thread_safe (0.1.3)
Using execjs (1.4.0)
Using jwt (0.1.8)
Using rack-test (0.6.2)
Using warden (1.2.3)
Using puma (2.7.1)
Using rack-protection (1.5.0)
Using vegas (0.1.11)
Using treetop (1.4.15)
Using launchy (2.3.0)
Using nokogiri (1.6.0)
Using less (2.3.2)
Using crack (0.4.1)
Using dotenv-rails (0.8.0)
Using foreman (0.63.0)
Using faye-websocket (0.4.7)
Using faraday (0.8.8)
Using git_hub_bub (0.0.2)
Using omniauth (1.1.4)
Using httparty (0.11.0)
Using mail_view (1.0.3)
Using sprockets (2.10.1)
Using mocha (0.14.0)
Using rails_12factor (0.0.2)
Using unicorn (4.6.3)
Using redis-namespace (1.3.0)
Using simplecov (0.7.1)
Using activesupport (4.0.3)
Using coffee-script (2.2.0)
Using uglifier (2.1.2)
Using sinatra (1.4.3)
Using mail (2.5.4)
Using xpath (2.0.0)
Using webmock (1.13.0)
Using oauth2 (0.8.1)
Using actionpack (4.0.3)
Using activemodel (4.0.3)
Using shoulda-matchers (2.2.0)
Using skylight (0.1.8)
Using resque (1.24.1)
Using capybara (2.1.0)
Using omniauth-oauth2 (1.1.1)
Using actionmailer (4.0.3)
Using railties (4.0.3)
Using less-rails (2.3.3)
Using sprockets-rails (2.0.1)
Using activerecord (4.0.3)
Using shoulda (3.5.0)
Using resque_def (0.0.3)
Using poltergeist (1.3.0)
Using omniauth-github (1.1.1)
Using coffee-rails (4.0.0)
Using devise (3.0.1)
Using jquery-rails (3.0.4)
Using quiet_assets (1.0.2)
Using sass-rails (4.0.0)
Using sprockets_better_errors (0.0.4)
Using rails (4.0.3)
Using phantomjs (1.8.1.1)
Using maildown (1.0.1)
Using rails_autolink (1.1.0)
Using wicked (1.0.0)
Using teaspoon (0.7.4)
Using puma_auto_tune (0.0.1) from git://github.com/schneems/puma_auto_tune.git (at master)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
2.1.1  ~/documents/projects/codetriage (master)
$ rails c
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:2: warning: already initialized constant GitHubBub::Request::USER_AGENT
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:7: warning: previous definition of USER_AGENT was here
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:3: warning: already initialized constant GitHubBub::Request::RETRIES
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:12: warning: previous definition of RETRIES was here
/Users/schneems/Documents/projects/codetriage/config/initializers/git_hub_bub.rb:4: warning: already initialized constant GitHubBub::Request::GITHUB_VERSION
/Users/schneems/.gem/ruby/2.1.1/gems/git_hub_bub-0.0.2/lib/git_hub_bub/request.rb:8: warning: previous definition of GITHUB_VERSION was here
Loading development environment (Rails 4.0.3)
irb(main):001:0> Wicked::Wizard
=> Wicked::Wizard

What happens when you

$ irb
> require 'rubygems'
> require 'wicked'

??? What version of bundler are you using? Can you try upgrading to the latest?

@pbraswell

This comment has been minimized.

Show comment
Hide comment
@pbraswell

pbraswell Mar 6, 2014

Hey Richard,
Thanks for the quick reply.

In answer to your questions, I've got the latest version of bundler.

Here's a transcript of irb:

*➜  **checkride **git:(**build_debrief_wizard**) **✗* irb

2.0.0-p353 :001 > require 'rubygems'

 => false

2.0.0-p353 :002 > require 'wicked'

NameError: uninitialized constant
Wicked::Controller::Concerns::RenderRedirect::ActiveSupport

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked/controller/concerns/render_redirect.rb:2:in
`<module:RenderRedirect>'

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked/controller/concerns/render_redirect.rb:1:in
`<top (required)>'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in
`require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in
`require'

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked.rb:19:in
`<top (required)>'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
`require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
`rescue in require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
`require'

from (irb):2

from /Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>'

2.0.0-p353 :003 >


Now when I do the same in the Rails console, I get something different:

Loading development environment (Rails 4.0.3)

2.0.0-p353 :001 > require 'rubygems'

 => false

2.0.0-p353 :002 > require 'wicked'

 => false

2.0.0-p353 :003 >

Thanks for your help on this!

Hey Richard,
Thanks for the quick reply.

In answer to your questions, I've got the latest version of bundler.

Here's a transcript of irb:

*➜  **checkride **git:(**build_debrief_wizard**) **✗* irb

2.0.0-p353 :001 > require 'rubygems'

 => false

2.0.0-p353 :002 > require 'wicked'

NameError: uninitialized constant
Wicked::Controller::Concerns::RenderRedirect::ActiveSupport

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked/controller/concerns/render_redirect.rb:2:in
`<module:RenderRedirect>'

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked/controller/concerns/render_redirect.rb:1:in
`<top (required)>'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in
`require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in
`require'

from /Users/peterbraswell/.rvm/gems/ruby-2.0.0-p353@checkride/gems/wicked-1.0.2/lib/wicked.rb:19:in
`<top (required)>'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
`require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
`rescue in require'

from
/Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
`require'

from (irb):2

from /Users/peterbraswell/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>'

2.0.0-p353 :003 >


Now when I do the same in the Rails console, I get something different:

Loading development environment (Rails 4.0.3)

2.0.0-p353 :001 > require 'rubygems'

 => false

2.0.0-p353 :002 > require 'wicked'

 => false

2.0.0-p353 :003 >

Thanks for your help on this!

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 6, 2014

Owner

It's coming from here:

https://github.com/schneems/wicked/blob/master/lib/wicked/controller/concerns/path.rb#L2

I've updated master to explicitly require the AS modules we're using. Can you try setting github: "schneems/wicked" in your gemfile?

In the rails console what happens when you try to use a wicked constant?

Owner

schneems commented Mar 6, 2014

It's coming from here:

https://github.com/schneems/wicked/blob/master/lib/wicked/controller/concerns/path.rb#L2

I've updated master to explicitly require the AS modules we're using. Can you try setting github: "schneems/wicked" in your gemfile?

In the rails console what happens when you try to use a wicked constant?

@camkidman

This comment has been minimized.

Show comment
Hide comment
@camkidman

camkidman Jul 26, 2014

+1 at github: "schneems/wicked" -- I was getting the same problem.

+1 at github: "schneems/wicked" -- I was getting the same problem.

@crazyivan

This comment has been minimized.

Show comment
Hide comment
@crazyivan

crazyivan Sep 5, 2014

+1 at github: "schneems/wicked" -- was also getting the same problem. (with v1.0.3)

+1 at github: "schneems/wicked" -- was also getting the same problem. (with v1.0.3)

@fbshah

This comment has been minimized.

Show comment
Hide comment
@fbshah

fbshah Jan 31, 2016

New to Ruby on Rails, unsure on how to integrate the Wicked gem with Devise.
I am using the confirmable module, which sends an email to confirm account after inserting email and password.

How do I enable Devise to confirm after all the registrations steps are completed rather than after the initial sign up page?

fbshah commented Jan 31, 2016

New to Ruby on Rails, unsure on how to integrate the Wicked gem with Devise.
I am using the confirmable module, which sends an email to confirm account after inserting email and password.

How do I enable Devise to confirm after all the registrations steps are completed rather than after the initial sign up page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment