-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Booting app with Devise and Bundler failed #32
Comments
Devise relies on Rails require_dependency, which bundler does not use. require_dependency knows that Devise::Controllers::Filters is available at "devise/controllers/filter" and loads that file automatically. Using bundler, that file cannot be loaded and should be required manually. |
After a talk with Yehuda, we agreed that the bundler preinitializer for Rails 2.3 needs to be improved, something along those lines might make it work:
|
I've tried the code and it failed on: c:\dev\MUNI\Bakalarka\portfonica>ruby script\server c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:6:in `block in ': undefined method `require_dependency' for main:Object (NoMethodError) from c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:5:in `each' from c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:5:in `' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:28:in `load' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:28:in `preinitialize' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:10:in `boot!' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:110:in `' from script/server:2:in `require' from script/server:2:in `' |
Hrm, so try it at the end of config/environment.rb. |
It has not helped, it returns the same problem like in my first report. But It is okay. It seems to be a problem in Bundler, so sorry for reporting here :). |
No problem. Just one more try. Instead of "require_dependency" try "ActiveSupport::Dependencies.require_dependency" or simple adding it to load path "ActiveSupport::Dependencies.load_path <<". |
Hi! I'm in the same problem, my configuration is the following: class Rails::Boot def extend_environment preinitializer.rb require "#{RAILS_ROOT}/vendor/bundled_gems/environment" And I'm tried all your options but nothings happens, I've received the following errror: undefined method Thanks |
I just noticed the code above was wrong, here is the proper version: require "#{File.dirname(FILE)}/../vendor/bundler_gems/environment" Gem.loaded_specs.values.each do |spec| If this does not work, try doing require "devise" in your initializer/preinitializer. If that does not work, I do not know how to help any longer. This is more a bundler issue though. |
I'm getting this error with Devise and Bundler. If I run app without Devise, it is okay.
My settings is here:
http://github.com/wycats/bundler/issues#issue/88
I declared nothing Devise anywhere. No configuration in environment.rb or used an initializer. I just specified it in my Gemfile.
The text was updated successfully, but these errors were encountered: