我试图在IIS上运行的轨道,我也跟着提到的步骤在这里由Scott Hanselman的.
以下是一些可能有用的信息:
在我按照设置步骤操作后,我反驳了这个问题
HTTP错误502.3 - 错误的网关
尝试路由请求时出现连接错误.
最可能的原因:
CGI应用程序未返回有效的HTTP错误集.
由于父网关中的错误,充当代理或网关的服务器无法处理请求.
你可以尝试的事情:
使用DebugDiag对CGI应用程序进行故障排除.
确定代理或网关是否应对此错误负责.
这是我的web.config文件内容.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<httpPlatform processPath="C:\RailsInstaller\Ruby2.3.3\bin\ruby.exe" arguments=""C:\RailsInstaller\Ruby2.3.3\bin\rails" server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1" startupTimeLimit="200" stdoutLogEnabled="true" stdoutLogFile="rails.log">
<environmentVariables>
<environmentVariable name="RAILS_ENV" value="development" />
</environmentVariables>
</httpPlatform>
<directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension" />
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我不确定问题是什么,我想念的配置是什么!
我试图了解rails如何知道两条路线之间的区别
GET /users/:id
和
GET /users/new
当我们打字
resources :users
我试图跟踪并理解rails源代码中的资源方法,但我完全不了解它.
def resources(*resources, &block)
options = resources.extract_options!.dup
if apply_common_behavior_for(:resources, resources, options, &block)
return self
end
with_scope_level(:resources) do
options = apply_action_options options
resource_scope(Resource.new(resources.pop, api_only?, @scope[:shallow], options)) do
yield if block_given?
concerns(options[:concerns]) if options[:concerns]
collection do
get :index if parent_resource.actions.include?(:index)
post :create if parent_resource.actions.include?(:create)
end
new do
get :new
end if parent_resource.actions.include?(:new)
set_member_mappings_for_resource
end
end
self
end
Run Code Online (Sandbox Code Playgroud)
下面的代码是那样做的吗?
new do
get :new
end if parent_resource.actions.include?(:new)
Run Code Online (Sandbox Code Playgroud)
如果有,你能解释一下吗?
另外,如果我试着写用相同的另一条路线GET users/new重定向到的格式GET users/:id,所以我怎么能写这样另一条路线 …