English 中文(简体)
如何与WampServer一道在铁路上安装Ruby?
原标题:How to install Ruby on Rails alongside WampServer?
最佳回答

我与WampServer一道在铁路安装了Ruby。 如何做到这一点:

<代码>C:wamp,在以下案文中,由您自己的WampServer安装存放处替换。

Installing Duncan:

  1. Download Ruby. Use the Windows binary version, not the "one click installer" because it contains MySQL and Apache which we don t need.
  2. Extract the zip to C:wamp uby.
  3. 3. 在贵太平洋建筑工程环境变量中添加Rub和双层储存:

    1. Right click "Computer / Properties".
    2. Click "Advanced System Settings".
    3. Advanced tab / Environment Variables.
    4. Append ;C:wamp ubyin to the Path variable.

Installing DevKit:

下载DevKit:

  1. Extract DevKit to c:wamp ubyDevKit.
  2. cd /d c:wamp ubyDevKit.
  3. ruby dk.rb init

    • Add - c:wamp uby to the end of config.yml.
  4. http://www.un.org。

铁路和Mongrel服务器:

  1. 1. 开放指挥线和类型:

    gem install rails
    
  2. 通过从<条码>C:wampwww ails和打字开放指挥线,创建您的第一个铁路应用:

    rails hello
    
  3. 在Mongrel服务器和Windows Mongrel服务中,确保作为管理人管理指挥线:

    gem install mongrel and 
    gem install mongrel_service
    
  4. • 安装铁道应用视窗服务:

    mongrel_rails service::install -N ruby-hello -c c:wampwww
    ailshello -p 3001 -e development
    
  5. 开始 Mongrel Service:

    net start ruby-hello
    

我们现在可在<条码>上查阅你的铁路申请:http:// localhost:3001/。

与阿帕奇结合

  1. Enable mod_proxy in httpd.conf.

    开放式httpd.conf(c:wampinapacheApache2.x.confhttpd.conf)和以下线路:

    LoadModule proxy_module modules/mod_proxy.so
    
  2. 您的Mongrel服务器接通交通。 在您的httpd.conf(或httpd-vhosts)上添加以下案文。 汇合如果列入你的网页。 会议:

    <VirtualHost *:80>
    ServerName hello.com
    ServerAlias *.hello.com
    ProxyPass / http://localhost:3001/
    ProxyPassReverse / http://localhost:3001
    </VirtualHost>
    
  3. Add hello.com至您的主人档案。 开放式<代码>c:windowssystem32driversetchosts in Notepad and Add. following line:

    127.0.0.1 www.hello.com hello.com
    

我们现在可以到,并应当装载你的铁路应用。

参考资料:

问题回答

是的, http://instantrails.rubyforge.org/wiki/wiki.pl"rel=“noreferer”

假设你重新努力营造一种发展环境,因为使用Windows和/或WAMP作为生产服务器并不大。

可以通过Ruby 安装器安装。 这里还有,其中包括一些图书馆(尽管你可以在晚些时候安装这些网络)。

你的正确之处是,你将铁路(和附属设施)作为 g。

现在,正如阿帕奇一样。 我会说,你会把西米斯大学的安装工作保留下来,而只是不把它用于鲁比拉/拉勒斯。 鲁比拥有一个称为WEBrick的网络服务器,还有另一个称为Mongrel的轻重服务器(可作为一个宝)。 这些项目可以与阿帕奇同时进行,阿帕奇为PHP和Mongrel/WEBrick为铁路服务。 他们停靠不同港口(Apache,80岁,Mongrel/WEBrick,3 000岁),因此没有任何冲突。

这种办法有若干优势:

  1. You won t have to mess with your WAMP installation and risk screwing something up.
  2. Running applications from different languages separately protects them from each other. For example, if your Rails app crashes the server, it won t bring your PHP stuff down with it in case you re running both.
  3. Thirdly, most popular Rails IDEs (RubyMine, Aptana, etc) have built-in controls for both or one of the Mongrel and WEBrick servers. This means that you ll be able to start/stop/restart your server within the IDE, as well as display the output/logs. For Rails development in Windows, I recommend RubyMine.

我的SQL与阿帕奇分开,因此,你的铁路机能进入MySQL数据库,而无论哪一个服务器正在为其内容服务。 当然,你必须至少管理西澳大利亚集体党的MySQL版本,以便工作。

To install+run Ruby On Rails application on localhost (wampserver or etc):

http://www.helicontech.com/zoo/install.html


OR

1) Install WAMP (or etc)
2) Install
Ruby
3) open ...wampinapacheapacheXXXXconfhttpd.conf, then search & replace
Options Indexes FollowSymLinks
with
Options Indexes FollowSymLinks ExecCGI (or Options Indexes FollowSymLinks Includes ExecCGI)
p.s. also, Find & ensure that LoadModule cgi_module is NOT commented.

4) search & replace
#AddHandler cgi-script .cgi
with (...removing # )
AddHandler cgi-script .cgi
AddHandler cgi-script .rb

5) Find the line: DirectoryIndex index.php index.php3 index.html index.htm
and add in the end of them: index.cgi index.rb
Now, Restart Apache.

6) 创建<><<>mple.rb(根植/www. 根基):

#!C:Ruby200in
uby
uby.exe
puts "Content-type: text/html" #in newer version, might be puts("....")
puts ""
puts "Test Pageeeeeeeee."

p.s. NOTE: (a) Change C:|Ruby.. path to your RUBY installation path correctly. (b) To avoid problems, dont install RUBY in a path, wherein any "folder name" contains a space. (c) There should not be a space between the start of line and print(..

开放式<代码>http:// localhost/sample.rb



p.s.note, in come cases, while using .htaccess [inside .rb directory], you might need to insert these lines in .htaccess:
Options +ExecCGI
AddHandler cgi-script .rb





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签