jjzjj

apache-config

全部标签

ruby-on-rails - 在 Apache 下的子目录中配置 Ruby On Rails App

我在Windows上安装了apache2.2。我正在尝试同时提供颠覆(/svn)和redmine(/redmine)。我的svn使用此配置运行良好:DAVsvnSVNParentPathC:/svn_repository...这很好用——我的svn用户可以点击http://mybox/svn就好了。现在我想为Rails应用程序(RedMine)添加另一个目录:我遵循了thisquestion中的建议设置杂种服务器并让apache代理客户端连接到它。如果我将它设为根目录,它工作正常——但我在将它设为子目录时遇到了问题:ProxyPasshttp://localhost:3000/Prox

ruby-on-rails - 为什么 Rails 生成运行类而不是对象的 config.ru?

RackspecifiesARackapplicationisaRubyobject(notaclass)thatrespondstocall.因此,一个简单的config.ru看起来像这样:classMyAppdefcall(env)[200,{"Content-Type"=>"text/plain"},["HellofromRack!\n"]]endendrunMyApp.new当Rails生成这个时:#ThisfileisusedbyRack-basedserverstostarttheapplication.require::File.expand_path('../confi

ruby-on-rails - Rspec.config 之前(:each) except for specific :types

我正在尝试获取一个before(:each)block以针对所有规范excepttype::feature运行。我让它工作的唯一方法是剪切和粘贴,并为每种类型设置单独的配置block。(:type=>:model,:type=>:service等)spec/rails_helper.rb#Tospeeduptests,stuballPaperclipsavingandreadingto/fromS3config.before(:each,:type=>:model)doallow_any_instance_of(Paperclip::Attachment).toreceive(:sav

ruby-on-rails - 使用 passenger 在 Apache 上设置 Rails 应用程序 - Rails 似乎无法加载

我正在尝试按照https://help.ubuntu.com/community/RubyOnRails等文档在Ubuntu实例上设置Rails.我正在尝试从此处的Rails入门页面设置应用程序:http://guides.rubyonrails.org/getting_started.html.到目前为止我做了什么:通过RVM和GEM安装Ruby/RubyGems/Rails(这安装了Ruby1.9.2和Rails3.0.7)安装mysql和mysql2模块(后者不起作用)创建Rails应用程序(教程指导的博客应用程序)/home/me/www/blog/public/来自/var/

ruby-on-rails - 如何防止 Rails Controller 生成器修改 config/routes.rb

有时我会运行类似railsgcontrollerfooindex的命令来生成Controller和模板的骨架。因为我不希望每个Controller都有助手和Assets,所以我将以下代码放入config/application.rb:config.generatorsdo|g|g.helperfalseg.assetsfalseend还有一件事我不想发生。生成器将一行get"foo/index"添加到我的config/routes.rb。我该如何预防? 最佳答案 从Rails4.2开始,可以在application.rb中使用以下代

ruby-on-rails - Ruby on Rails 3 + Apache2 + Phusion Passenger:Bundler::GemNotFound 异常

我正在尝试使用PhusionPassenger在Apache2服务器上部署Rails应用程序。虽然一切都在本地运行良好,但我在部署时遇到了臭名昭著的“Bundler::GemNotFound”错误:Couldnotfindabstract-1.0.0inanyofthesources(Bundler::GemNotFound)我所有的gem都安装在我的本地主文件夹中。因此,我的Apache2配置文件中的乘客配置行如下:LoadModulepassenger_module/home/regis/.gem/gems/passenger-3.0.7/ext/apache2/mod_passe

ruby-on-rails - 为什么 Apache 还没有可行的 mod_ruby?

尽管Ruby和Rails很流行,但这个问题似乎早就解决了。JRuby和mod_rails都很好,很花哨,但为什么没有直接用于Ruby的Apachemod? 最佳答案 有PhusionPassenger,一个强大的Apache模块,可以运行Rack最低配置的应用程序。它对共享主机越来越有吸引力,将任何程序变成Rack应用程序都非常容易:ARackapplicationisanRubyobject(notaclass)thatrespondstocall.Ittakesexactlyoneargument,theenvironmenta

ruby-on-rails - `secret_token` 环境缺少 `secret_key_base` 和 'development',在 `config/secrets.yml` 中设置这些值

当我尝试运行railsserver命令时出现错误如何解决?我的config/environments/development.rbRails.application.configuredoconfig.secret_key_base=ENV["SECRET_KEY_BASE"]#Somestuffend而且我的文件夹中没有secret.yml文件。 最佳答案 然后创建一个:配置/secrets.yml#besuretorestartyourserverwhenyoumodifythisfile...#Makesurethesecre

ruby - 在 Apache 中设置 Ruby CGI

我想通过CGI在Apache中使用Ruby。我的配置文件中有以下内容:DocumentRoot/home/ceriak/rubyOptions+ExecCGIAddHandlercgi-script.rbtest.rb是放在/home/ceriak/ruby/下的测试文件,#!/usr/bin/ruby包含在第一行并赋予可执行权限。不过,当我访问localhost/test.rb时,我会看到一个下载窗口并可以获得源代码。有趣的是,当我将相同的脚本放在/usr/lib/cgi-bin/下并调用localhost/cgi-bin/test.rb时,它按预期工作.(Ubuntu9.10上的A

ruby - sinatra config.ru : what is the configure block for?

我将Sinatra与Apache和“经典”风格的Phusion-Passenger一起使用:#config.rurequire'sinatra'configuredo....endrequire'./app'runSinatra::Application我想定义一些东西。在配置block内部或外部定义它有什么区别?#config.rurequire'sinatra'#A)Definingloggerhererack=File.new("logs/rack.log","a+")useRack::CommonLogger,rack#B)GlobalvariableshereLOGGER=L