spree_auth_devise icon indicating copy to clipboard operation
spree_auth_devise copied to clipboard

How To Properly Remove Gem

Open carltonsmith opened this issue 7 years ago • 6 comments

In installing Spree, I was following the instructions and inadvertently installed this gem in the process.

As it happens, my application is using a custom User class, so I don't need this gem. However, when I remove it, my application fails. I have followed the instructions on the Spree site for how to implement a custom user class, but when I remove the spree_auth_devise gem, the site won't launch. When I leave the gem in, the site will launch, but the login/logout links don't work correctly inside Spree. They are using the Spree routes, and not the routes I have defined in my routes.rb.

I need to know how to safely remove this gem from my installation.

carltonsmith avatar Oct 26 '17 21:10 carltonsmith

Can you post the error log when you try to start your application when the gem is not present in your Gemfile?

kinduff avatar Oct 27 '17 00:10 kinduff

Did you remove //= require spree/frontend/spree_auth from vendor/assets/javascripts/spree/frontend/all.js? and check config/initializers/devise.rb if there is something connected with spree_auth_devise

bbonislawski avatar Oct 27 '17 06:10 bbonislawski

This is from the error log:

Exiting
/Users/user/sites/site/app/controllers/application_controller.rb:8:in `<class:ApplicationController>': uninitialized constant Spree::AuthenticationHelpers (NameError)
	from /Users/user/sites/site/app/controllers/application_controller.rb:1:in `<top (required)>'

carltonsmith avatar Oct 27 '17 11:10 carltonsmith

I did not remove those things, but I will give that a try

carltonsmith avatar Oct 27 '17 11:10 carltonsmith

@bbonislawski After removing the ref to spree_auth in the frontend all.js, I tried running assets:precompile and got the same error I posted above. I also checked the devise.rb but the only thing in there is the secret key.

carltonsmith avatar Oct 27 '17 11:10 carltonsmith

@carltonsmith looks like app/controllers/application_controller.rb is raising an exception for Spree::AuthenticationHelpers, make sure your Spree setup + custom authentication is setup correctly. We can help you out more if you post more code examples about your setup.

kinduff avatar Oct 27 '17 15:10 kinduff