Ruby on rails 具有自定义域的生产中的Spree路由错误
我尝试使用自定义域在我的服务器上运行Spree。 每次我点击一个产品或我想登录时,服务器都会将我路由到127.0.0.1:3000,而不是正确的域 我已经尝试了几种解决方案,特别是在堆栈溢出方面,但我的问题仍然存在 例如,我尝试在我的应用程序控制器中添加以下行,该控制器在开发模式下工作:Ruby on rails 具有自定义域的生产中的Spree路由错误,ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,routing,spree,Ruby On Rails,Ruby On Rails 3,Ruby On Rails 4,Routing,Spree,我尝试使用自定义域在我的服务器上运行Spree。 每次我点击一个产品或我想登录时,服务器都会将我路由到127.0.0.1:3000,而不是正确的域 我已经尝试了几种解决方案,特别是在堆栈溢出方面,但我的问题仍然存在 例如,我尝试在我的应用程序控制器中添加以下行,该控制器在开发模式下工作: class ApplicationController < ActionController::Base def default_url_options if Rails.env.produc
class ApplicationController < ActionController::Base
def default_url_options
if Rails.env.production?
{:host => "myproduction.com"}
else
{}
end
end
end
我尝试在config/environments/production.rb中添加Rails.application.routes.default\u url\u options[:host]=“mydomainname.com”,并在/etc/hosts中为127.0.0.1添加自定义域
知道我的错在哪里吗
如果任何代码有帮助,我可以发布它。但是大多数配置文件没有更改