是否可以将Ruby on Rails与WampServer一起安装(并保留WampServer的Apache / MySQL安装)?
最佳答案
我在WampServer旁边安装了Ruby on Rails。这是操作方法:
将以下文本中的C:\wamp\
替换为您自己的WampServer的安装存储库。
安装Ruby:
C:\wamp\ruby\
。 ;C:\wamp\ruby\bin
附加到Path变量。 安装DevKit:
下载DevKit:
c:\wamp\ruby\DevKit
中。 cd /d c:\wamp\ruby\DevKit
。 ruby dk.rb init
。- c:\wamp\ruby
添加到config.yml
的末尾。 ruby dk.rb install
安装Rails和Mongrel服务器:
gem install rails
C:\wamp\www\rails\
的命令行并输入以下命令来创建您的第一个Rails应用程序:rails hello
gem install mongrel and
gem install mongrel_service
mongrel_rails service::install -N ruby-hello -c c:\wamp\www\rails\hello -p 3001 -e development
net start ruby-hello
您现在可以通过
http://localhost:3001/
访问Rails应用程序。与Apache集成
打开httpd.conf(c:\ wamp \ bin \ apache \ Apache2.x.x \ conf \ httpd.conf)并取消注释以下行:
LoadModule proxy_module modules/mod_proxy.so
<VirtualHost *:80>
ServerName hello.com
ServerAlias *.hello.com
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001
</VirtualHost>
c:\windows\system32\drivers\etc\hosts
并添加以下行:127.0.0.1 www.hello.com hello.com
现在,您可以转到http://www.hello.com,它将加载您的Rails应用程序。
引用文献: