ruby-on-rails - Spree:关闭 SSL 重定向/管理员返回站点

标签 ruby-on-rails ssl spree

我已经设置了一个新的 Rails 应用程序,安装了 spree gem (1.1.2),并且能够成功启动并运行 Spree,但是我没有 SSL 证书,只是想在之前搞乱 Spree我购买了证书等。我可以成功显示显示产品等的 spree 页面,但是当我转到/admin 时,它会重定向回网站的主页。这是日志显示的内容:

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)

我已更新 config/initializers/spree.rb 以包含

config.allow_ssl_in_production = false

这样它就不会使用 SSL。

这是我的 rake

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

我尝试过搜索,但没有成功;我发现的大部分内容都讨论了打开/关闭 SSL 的登台。如果有帮助,我的服务器使用 Phusion Passenger 进行部署(Site5)..

任何帮助或指导将不胜感激!谢谢!

最佳答案

经过更多搜索,我找到了问题的答案 here .

本质上你只需要安装另一个名为 spree_auth_devise 的 Gem .

关于ruby-on-rails - Spree:关闭 SSL 重定向/管理员返回站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11549901/

相关文章:

ruby-on-rails - 为什么我在Spree::UserSessionsController#new when install spree?中遇到了getSyntaxError

spree - 如何更改 spree 货币?

ruby-on-rails - 无法为应用程序生成进程

ruby-on-rails - Rails 和 Heroku : How many workers/dynos do I need

ruby-on-rails - 尝试升级 rails 依赖项会导致序列化程序引发错误 : undefined method `model_name' for Hash:Clas

docker - 通过 TLS 连接到 OPENLDAP : Certificate not found

ruby-on-rails - 使用 simple_form 将数据属性添加到单选按钮。

ssl - https 在 Xampp 上不起作用

java - 如何以编程方式设置 Axis 客户端的 SSL 上下文?

Spree:自定义产品的关键属性