1
votes

I want to set up Spree using the core, backend, and api gems. I've installed Spree 2-2-Stable, successfully ran migrations, seed, and set up the admin user, and rake routes returns the Spree routes provided by the API and Backend gems. I had thought the admin login would be provided by the Backend gem, but none of the controllers in the backend are currently accessible by the application (API controllers work fine).

Spree Setup: Installed 'spree', '2.2.2', then changed gemfile to include only core, backend, api. Did not include sample data. I would have started working from the default spree gem but was also getting errors there.

Spree.user_class = "Spree::User"

Gemfile:
gem 'rails', '4.0.5'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-2-stable'

gem 'spree_core', '~> 2.2.2'
gem 'spree_backend', '~> 2.2.2'
gem 'spree_api', '~> 2.2.2'

http://localhost:3000/admin/login => uninitialized constant Spree::Admin::UserSessionsController

http://localhost:3000/login => uninitialized constant Spree::UserSessionsController

I've looked for solutions to this issue but the results I've found are dealing with Spree extensions, or deal with much older versions of spree/rails.

Thank you!

1

1 Answers

1
votes

The Spree gem(s) need to come before 'spree_auth_devise' in the gemfile. The application is now working using the full spree gem, and I am confident I can move forward using the custom spree gems as well.

Also, user controllers and routes for Spree are set up in this file: https://github.com/spree/spree_auth_devise/blob/master/config/routes.rb

The controllers are also defined in the spree_auth_devise gem.