Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

script/generate devise_install not working #27

Closed
nprncbl opened this Issue · 19 comments

7 participants

@nprncbl

Hi everyone,

I installed the latest devise gem (0.4.1) but script/generate devise_install results in the following error:

$ script/generate devise_install
Couldn't find 'devise_install' generator

I wonder whether this is only a problem on my side, or if the generator is missing from the gem ...?

Best regards
Martin Eisenhardt

@josevalim
Owner

I just tried in my computer, using Devise 0.4.2:

rails foo
cd foo
script/generate devise_install

And it worked. It was supposed to work on devise 0.4.1 as well, but try upgrading it to check if it's broken for you or on 0.4.2 as well.

@nprncbl

Hi Jose,

thanks for the quick reaction.

Sadly, upgrading to 0.4.2 did not resolve the problem:

$ rails foo && cd foo
$ script/generate devise_install
Couldn't find 'devise_install' generator

Sorry for the inconvenience ...

@josevalim
Owner

This is quite odd that it's not working. Which rails are you using? (It won't work with Rails 3/edge...)

@nprncbl

I am using

  • Devise 0.4.2
  • Warden 0.5.1
  • Rails 2.3.4
  • ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
  • MacOS X 10.5.8

I do not use Rails Edge or Rails 3 ( I am not that fancy ... :-D )

@nprncbl

BTW: If this only affects me, then please do not bother. Devise is a great piece of code, and you should invest your time into perfecting and extending it.

@carlosantoniodasilva
Collaborator

Hello,
I've also tried it here the same way you did:
rails foo && cd foo
script/generate devise_install
And everything is fine.. Have you already tried adding warden and devise to your config.gem before running "script/generate devise_install"?

@nprncbl

Hi Carlos,

yes, the config.gem lines are in my environment.rb. Devise as such is working, I am able to login and manage user data. It is just that I cannot use the generator to create the devise initializer like everybody else seems to do ... :-(

@carlosantoniodasilva
Collaborator

It seems odd... as we can't reproduce here.. are all others Devise generators working fine?

@nprncbl

I know it is odd. I even removed the gems (Warden and Devise) and re-installed them. And yes, all other generators work fine, including

script/generate devise User

Thanks!

@nprncbl

Hi everyone, I just scrapped all my gems and reinstalled them via the corresponding rake task. Suddenly, everything works fine.

Strange, but not unwelcomed ... :-D

Thanks for your time, anyway!

@carlosantoniodasilva
Collaborator

Great it's working now!
You're welcome..
Closing....

@rubytastic

Well after cleaning really all gems * there where some left *
I get this :s

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- subdomain_routes (MissingSourceFile)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require'
from /Users/pascal/Desktop/Actus/apache2/rubydocs/portal/config/initializers/subdomain_routes.rb:2
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
load_without_new_constant_marking'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in load'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in load'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:622:in
load_application_initializers'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in each'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in
load_application_initializers'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:176:in process'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in
send'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in run'
from /Users/pascal/Desktop/Actus/apache2/rubydocs/portal/config/environment.rb:5
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/generate.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/generate:3

Anyone a solution?

@carlosantoniodasilva
Collaborator

Sorry, but what's the point with Devise?

@rubytastic

Never mind, my fault, it was late yesterday, above is fixed

@josevalim
Owner

C'mon guys. Let's work harder on fixing/understanding issues before reporting bugs. Our efforts can be better put in the source code than in the issues tracker. Thanks.

@martinstreicher

I had this issue as well (missing all generators). Deleting all versions of the devise gem and reinstalling with rake gems:install cleared the problem. This on Mac OS X.

@ghost

i get this problem when i have rails frozen in vendor/rails/
when i remove that directory, it gets rid of my problem, i use windows

@dip00dip

Same here. Have 2 versions of devise. devise (1.1.5, 1.0.8)
Can't generate anything.

Here's the solution - just uninstall newer version (for rails 3) and then generate.
Then reinstall it back.

@malclocke

This happens because ./script/generate searches the entire gem sources, but only the most recent versions of each. It ignores any values you have defined with config.gem.

So if you, like me, have devise 1.2.1 and 1.0.11 installed, ./script/generate will only look in the 1.2.1 gem for a generators/ directory. See lib/rails_generator/lookup.rb in the rails-2.3.x source.

Anyway, I'd say this is a Rails bug, not really a devise bug.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.