问题
I've setup a fresh rails app, installed the spree gem (1.1.2) and was able to successfully get Spree up and running however I don't have an SSL certificate and am just looking to mess around with Spree before I purchase a cert, etc. I can successfully show the spree page that would show products, etc., but when I go to /admin it redirects back to the home page of the site. This is what the log shows:
Started GET "/admin" for 76.122.36.219 at Wed Jul 18 15:25:42 -0500 2012
Processing by Spree::Admin::OverviewController#index as HTML
Redirected to http://**************.com/
Completed 302 Found in 139ms (ActiveRecord: 5.1ms)
I've updated the config/initializers/spree.rb to include
config.allow_ssl_in_production = false
so that it doesn't use SSL.
Here's my rake about
About your applications environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.6.2
Rack version 1.4
Rails version 3.2.6
JavaScript Runtime therubyracer (V8)
Active Record version 3.2.6
Action Pack version 3.2.6
Active Resource version 3.2.6
Action Mailer version 3.2.6
Active Support version 3.2.6
Middleware ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x70d884a28a50>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Application root /home/********/**************
Environment development
Database adapter mysql2
Database schema version 20120718173536
I've tried searching to no avail; most of what I've found discusses turning SSL on/off for staging. If it helps, my server uses Phusion Passenger for deployment (Site5)..
Any help or direction would be appreciated! Thanks!
回答1:
After searching some more I found the answer to the question here.
Essentially you just need to install another Gem called spree_auth_devise.
来源:https://stackoverflow.com/questions/11549901/spree-turning-off-ssl-redirects-admin-back-to-site