Articles of ruby on rails

Rails 3.0 – PCI兼容?

有谁知道如果Rails 3.0通过PCI合规性扫描?

如何在hosts文件中设置端口的域名?

我的笔记本电脑上运行了Apache和Rails。 Apache在端口80和rails 3000上运行。 在我的主机文件我有条目 127.0.0.1 dev.somesite.com 这适用于Apache 如何添加路由到端口3000的条目? 像127.0.0.1:3000 dev.somerailssite.com?

如何跟踪Ubuntu / Apache / MySQL / Rails + Passenger堆栈中的性能问题?

我在Ubuntu 8.04服务器上运行Apache 2.2.9,MySQL 5.1,Passenger 2.2.9和Rails 2.3.8(ruby 1.8.7-p72)的Rails堆栈有性能问题。 我如何跟踪堆栈中的性能问题?

Rails应用程序只在开发模式下运行,没有login生产

我创build了超级简单的rails应用程序 rails test cd test/ script/generate controller home index rm public/index.html # uncommented map.root :controller => "home" in config/routes.rb 当我在开发模式下运行应用程序,它工作得很好,一切都logging <VirtualHost *:80> DocumentRoot /opt/rails/test/public ErrorLog /opt/rails/test/log/error.log CustomLog /opt/rails/testlog/access.log combined RailsEnv development </VirtualHost> 但是当我改成RailsEnv制作时, RailsEnv production 我得到这个丑陋的错误页面 We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it […]

无法使用nginx写入Passenger 2.2.5中的日志文件

我有一个Rails应用程序,运行nginx和Passenger。 直到昨天,logging工作,但现在nginx的error.log启动时显示此消息:Rails的错误:无法访问日志文件。 请确保/var/www/app/htdocs/log/production.log存在并且是chmod 0666.日志级别已提升为WARN,输出指向STDERR,直到问题得到解决。 日志文件具有 0666权限。 看起来它可能与第332期有关,所以我从乘客2.2.4升级到2.2.5。 这并没有解决这个问题。 日志logging工作在昨天,并没有什么改变的configuration从那时起。 有任何想法吗?

Ubuntu服务器Karmic上的Mongrel群集

我试图让我的Ubuntu服务器Karmic框中的准备设置Capistrano的杂种群集。 我一直试图让这两个人整天工作,最后决定彻底删除Capistrano,看看我能不能让Mongrel Cluster工作。 我跑这个安装杂种群: gem install mongrel mongrel_cluster 一切安装好,当我改变到我的应用程序的目录… # mongrel_rails -bash: mongrel_rails: command not found 我可以从安装位置运行它: # /var/lib/gems/1.8/bin/mongrel_rails Usage: mongrel_rails <command> [options] Available commands are: … 它使我可以很好地构build群集configuration文件,但是当我运行clister:start命令时: # /var/lib/gems/1.8/bin/mongrel_rails cluster::start starting port 8000 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8000 -P tmp/pids/mongrel.8000.pid -l log/mongrel.8000.log starting port 8001 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not […]

访问/ app /下的Rails,而不是/ app / public /

我试图用Apache 2.2.10和FastCGI来部署Rails 2.1.2(我知道是的,坏的,古老的,丑陋的)。 我的应用程序可以通过example.com/app/public/访问,但是我想通过example.com/app/访问它。 在我的.htaccess文件(在应用程序/目录!)我有: RewriteEngine On RewriteBase /app/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ public/dispatch.fcgi [QSA,L] 我怎样才能转发每个请求去app/到app/public/ ? 每次我尝试这个(例如,用RewriteRule ^.*$ public/$1 [QSA] ),我得到一个路由错误: No route matches "/app/" with {:method=>:get} 帮帮我?

无法从本地主机连接到Cassandra DB

我不知道我是否在正确的站点,我安装OpenSolaris单个cassandra节点,我没有其他节点。 在同一台服务器上,我安装了带有Cassandra的Ruby 1.8。 如果我尝试从我的电脑通过rubycassandra连接到Cassandra节点,我可以完美地连接,如果我尝试从服务器上的rubygess cassandra得到同样的结果,则说127.0.0.1上没有监听。 我可以使用telnet 127.0.0.1 9160本地连接到实例,它可以工作… 任何想法? 谢谢!

使用Passenger与dynamic大容量虚拟主机/ userdirs

我已经有了一个Apache web服务器设置,它正在为PHP工作。 它没有静态的VirtualHosts设置,并dynamic路由所有请求。 http://example.com/的请求将通过文档根目录/var/www/example.com )提供,并且http://example.com/~user/的请求将从文档根目录/home/user/public_html (mod_userdir)。 后者工作,不pipe域名。 我希望能够使用Phusion Passenger从文档根目录或子目录中为Ruby on Rails应用程序提供服务。 但是,它需要我添加一些行到<VirtualHost>指令,显然不存在。 我更喜欢一个不需要root的解决scheme来部署应用程序,但这并不重要。 如果我具有相同的易用性,我也不介意不使用Passenger的解决scheme。

主机导轨应用程序从apache userdirs(mod_userdir)

我正在使用mod_userdir设置的服务器上工作,允许用户使用他们的public_html空间托pipe(例如)下的网页: http://example.com/~user/ 其中“user”是用户名,并指向/ home / user / public_html /。 有没有办法让我允许用户在他们的public_html目录中托piperails应用程序?