Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 具有自定义域的生产中的Spree路由错误_Ruby On Rails_Ruby On Rails 3_Ruby On Rails 4_Routing_Spree - Fatal编程技术网

Ruby on rails 具有自定义域的生产中的Spree路由错误

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

我尝试使用自定义域在我的服务器上运行Spree。 每次我点击一个产品或我想登录时,服务器都会将我路由到127.0.0.1:3000,而不是正确的域

我已经尝试了几种解决方案,特别是在堆栈溢出方面,但我的问题仍然存在

例如,我尝试在我的应用程序控制器中添加以下行,该控制器在开发模式下工作:

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添加自定义域

知道我的错在哪里吗

如果任何代码有帮助,我可以发布它。但是大多数配置文件没有更改