- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否有人有明确的说明来设置jRuby以与IIS一起使用。
编辑:
我正在寻找逐步说明,以使IIS上的Ruby on Rails应用程序可以在Windows和IIS上运行。原因是因为在野外提问时,除了“使用Linux”之外,我找不到其他东西。对于大多数人来说,Windows是主要的开发和部署环境,因此使用基于Linux的服务器是不可能的。 IIS随Windows一起提供,并提供与Active Directory的高级集成,因此也不用使用Apache。
最后一件事是使用war文件是一场噩梦,请提供有关如何通过仅复制文件或其他任何方式然后使用war文件来部署Rails应用程序的说明。
最佳答案
它实际上只是您要在IIS上部署的Rails应用程序,还是必须是JRuby?如果只是Ruby on Rails而不是JRuby,则here is your step-by-step guide。但是,如果您是JRuby,那么您想使用IIS,就别无所求了。以下是我遵循的步骤;我的环境是Windows 7 RC,Java 1.6.0_13上的IIS7。
首先,我从http://dist.codehaus.org/jruby/1.3.1/jruby-bin-1.3.1.tar.gz
下载了JRuby。
然后,我将存档提取到C:\JRuby
。
我将环境变量JRUBY_HOME设置为c:\JRuby\jruby-1.3.1
。
我在路径中添加了%JRUBY_HOME%\bin
。
我将穿插屏幕抓取,逐步进行下一步。
让我们运行jruby确认它已成功安装:
C:\Users\Vinay>jruby -vjruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.6.0_13) [x86-java]
OK so far. Let's use JRuby to install Rails:
C:\Users\Vinay>gem install json-jrubyC:\Users\Vinay>gem install rails --no-rdocJRuby limited openssl loaded. gem install jruby-openssl for full support.http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSLSuccessfully installed activerecord-2.3.3Successfully installed rack-1.0.0Successfully installed actionpack-2.3.3Successfully installed actionmailer-2.3.3Successfully installed activeresource-2.3.3Successfully installed rails-2.3.36 gems installedInstalling ri documentation for activerecord-2.3.3...Installing ri documentation for rack-1.0.0...Installing ri documentation for actionpack-2.3.3...Installing ri documentation for actionmailer-2.3.3...Installing ri documentation for activeresource-2.3.3...Installing ri documentation for rails-2.3.3...
Let's create a Rails app called jror
:
C:\Users\Vinay\Projects>rails new jror create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create config/locales create db create doc create lib create lib/tasks create log create public/images create public/javascripts create public/stylesheets create script/performance create test/fixtures create test/functional create test/integration create test/performance create test/unit create vendor create vendor/plugins create tmp/sessions create tmp/sockets create tmp/cache create tmp/pids create Rakefile create README create app/controllers/application_controller.rb create app/helpers/application_helper.rb create config/database.yml create config/routes.rb create config/locales/en.yml create config/initializers/backtrace_silencers.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/new_rails_defaults.rb create config/initializers/session_store.rb create config/environment.rb create config/boot.rb create config/environments/production.rb create config/environments/development.rb create config/environments/test.rb create script/about create script/console create script/dbconsole create script/destroy create script/generate create script/runner create script/server create script/plugin create script/performance/benchmarker create script/performance/profiler create test/test_helper.rb create test/performance/browsing_test.rb create public/404.html create public/422.html create public/500.html create public/index.html create public/favicon.ico create public/robots.txt create public/images/rails.png create public/javascripts/prototype.js create public/javascripts/effects.js create public/javascripts/dragdrop.js create public/javascripts/controls.js create public/javascripts/application.js create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log
Let's run WEBrick
to make sure everything's working as expected:
C:\Users\Vinay\Projects\jror>jruby script/server=> Booting WEBrick=> Rails 2.3.3 application starting on http://0.0.0.0:3000JRuby limited openssl loaded. gem install jruby-openssl for full support.http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL=> Call with -d to detach=> Ctrl-C to shutdown server[2009-07-21 17:51:21] INFO WEBrick 1.3.1[2009-07-21 17:51:21] INFO ruby 1.8.6 (2009-06-15) [java][2009-07-21 17:51:21] INFO WEBrick::HTTPServer#start: pid=2440 port=3000
Navigate to http://localhost:3000/
and confirm that your Rails application appears.
Sure enough, there it is.
The next thing is to set up a mechanism whereby selected requests made to IIS are proxied to JRuby. To do this, an URL rewriter/reverse proxy is needed. I used ISAPI Rewrite 3 for this. You may choose to use a different tool (for example, Microsoft ISA). ISAPI Rewrite 3 is good value at $99 per server, and comes with a 45-day trial period.
For ISAPI Rewrite 3, I set up the httpd.conf
configuration file as follows:
RewriteEngine onRewriteBase /RewriteLog "C:\temp\rewrite.log"RewriteLogLevel 9RewriteProxy jror/(.*) http://localhost:3000/$1
This proxies URLs of the form
http://localhost/jror/abc123
http://localhost:3000/abc123
http://localhost/jror/
并通过IIS查看JRuby服务的请求:
Grizzly
)和一些实用程序组成,因此可进行最小设置。让我们安装gem:
httpd.conf
中)将代理更改为指向Glassfish服务器使用的IP地址和端口之外,在IIS端不需要进行任何更改。如果您想全力以赴并安装完整的Glassfish服务器并在其上运行Rails应用程序,则最好遵循Glassfish团队的
these instructions。它们涵盖了安装和运行Glassfish,服务器,部署和取消部署Rails应用程序以及在生产模式下运行这些应用程序。
关于ruby-on-rails - 设置IIS和jRuby的说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1086994/
当我查看 IIS 日志文件时,我可以在一天中的不同时间看到标题行被写入日志文件。我唯一一次看到这种情况发生是在 IIS 重置时;或启动。 例如下面的标题行; #Software: Microsoft
有谁知道为什么以下 web.conig 更改不起作用: 在我添加 javascript 文件后仍然没有被压缩(gzip)。我折腾了几天,因为一开始我真的不知道问题是
目前,我们所有的网络应用程序都将其应用程序池标识设置为 ApplicationPoolIdentity。现在,当一个应用程序需要访问某些服务器上的某些资源时,比如添加/读取某些文件,该应用程序会在代码
在 IIS(特别是 6.0)中,在“主目录”选项卡下,如果我更改本地路径,是否会导致 IIS 重新启动或应用程序池回收? 相关的,是否有概述 IIS 元数据库的哪些更改将触发重新启动或应用程序池回收的
只要更改了任何 web.config 文件,AFAIK IIS 就会重新启动。 我创建了自己的配置文件(my.config,层次结构略有不同)。是否有可能让 IIS 自动(自动神奇地 :))重新启动,
你好, 我正在寻找 IIS 日志中列出的浏览器条目列表,以帮助识别访问我们网站的不同版本的浏览器。也许没有一个列表,而是一个应该用来识别不同浏览器及其版本的算法。 请注意,我不是在寻找日志分析器,而是
我想知道上次重新启动 iis 是什么时候。 IIS 是否保留了此日志,我在哪里可以找到此日志? 谢谢 最佳答案 打开事件查看器,导航到“Windows 日志”->“系统” 在右侧的“操作” Pane
在全新安装的带有 IIS 7 的 Windows Server 2008 R2 上,它会在 C:\inetpub\wwwroot 中创建一个默认网站。 .我确信对于存储网站文件的好位置有很多主观意见,
我已按照 this question 中的说明在 IIS 中实现动态内容压缩。 . 当我发送请求时,我看不到响应被 gzip 压缩的任何证据: IIS版本为7.5 有什么明显的我应该检查以解决此问题吗
这是场景: 服务器 A 托管“主”应用程序 (www.example.com) 服务器 B 托管支持应用程序 (b.example.com) 它们通过 192.* 地址在内部相互连接,并且都可以通过
是否有任何替代 IIS 管理 UI 可用于从程序重置 IIS?.. 现在我们已经创建了一个批处理文件,如果 iis 重置并每小时安排一次...... 我只是想要一些东西,这样我们就不能重置 iis..
我的 Windows Server 在 IIS 7.5 上运行 Web 应用程序。 我想知道为什么 IIS 应用程序池使用大量内存。 请参阅我从服务器捕获的屏幕截图。 在名为 TEST 2.0(.NE
我在 IIS 7.5 上运行的 ASP Classic 站点上收到服务器错误。 我将“向浏览器发送错误”设置为 True ,但是我仍然收到以下错误屏幕: 最佳答案 IIS 正在劫持您的经典 ASP 应
我正在尝试通过IIS上的反向代理连接到websockets服务器(websockify)。 IIS和Websockets服务器位于同一台物理服务器上(Windows Server 2012 R2,II
我需要让我的开发机器从本地机器商店读取证书 为此,我需要运行winhttpcertcfg.exe并指定我要提升的帐户 该帐户用于IIS表示什么? (对于IIS,它将是IWAM_MachineName)
我正在阅读特定命令(SET-WEBCONFIGURATIONPROPERTY),但出现"is not recognized as a cmdlet"错误。给我的建议是,即使我使用的是SharePoin
我已经为 IIS8 安装了静态和动态压缩并启用了它。 当我的CPU性能100%时,我的GZIP IIS不工作,为什么? 我可以清楚地看到 GZIP 没有在 Live HTTP header 中运行。我
我已经从官方镜像(https://hub.docker.com/r/microsoft/iis/)运行了IIS 在Windows Server 2016上 有什么方法可以从IIS管理器连接到该IIS,
你好, 如果 iis 未运行,我想编写一个状态为的代码。 最佳答案 从命令行启动 IIS: iisreset /start 从命令行停止 IIS: iisreset /stop 重新启动(停止和启动)
我已经为 IIS8 安装了静态和动态压缩并启用了它。 当我的CPU性能100%时,我的GZIP IIS不工作,为什么? 我可以清楚地看到 GZIP 没有在 Live HTTP header 中运行。我
我是一名优秀的程序员,十分优秀!