我们在CentOS 6上运行一个带有ROR的网站,带有2个Web服务器和1个数据库服务器.有时它显示消息"网站负载很重"...有些人可以帮助你在这里检查什么.
我们使用Passenger 4.0.21与Ruby 1.8.7和Apache 2.2.15.Web服务器正在使用默认设置运行.
以下是乘客身份的一些输出:
#passenger-status
Version : 4.0.21
Date : Thu Dec 12 02:02:44 -0500 2013
Instance: 20126
----------- General information -----------
Max pool size : 6
Processes : 6
Requests in top-level queue : 0
----------- Application groups -----------
/home/web/html#default:
App root: /home/web/html
Requests in queue: 100
* PID: 20290 Sessions: 1 Processed: 53 Uptime: 24h 3m 5s
CPU: 0% Memory : 634M Last used: 23h 16m 8
* PID: 22657 Sessions: 1 Processed: 37 Uptime: …Run Code Online (Sandbox Code Playgroud) 我有Rails3.2.3 Apache和Passenger.
我有一个项目在开发模式下工作.当我将项目切换到生产模式(Passenger标准)时,它给了我一个HTTP Error 500:
我们很抱歉,但有些不对劲.
即使这样也会发生WEBrick.有人能帮助我吗?
编辑:
我的生产环境文件:http: //pastebin.com/ZAudSzkc
我刚刚安装了Passenger 3.0.11和nginx并得到了这个错误:
启动nginx:/ opt/nginx/sbin/nginx:加载共享库时出错:libpcre.so.0:无法打开共享对象文件:没有这样的文件或目录
我们刚刚从乘客迁移到独角兽,以便托管几个rails应用程序.一切都很好但我们通过New Relic注意到请求在100到300毫秒之间排队.
这是图表:

我不知道这是从哪里来的这是我们的独角兽conf:
current_path = '/data/actor/current'
shared_path = '/data/actor/shared'
shared_bundler_gems_path = "/data/actor/shared/bundled_gems"
working_directory '/data/actor/current/'
worker_processes 6
listen '/var/run/engineyard/unicorn_actor.sock', :backlog => 1024
timeout 60
pid "/var/run/engineyard/unicorn_actor.pid"
logger Logger.new("log/unicorn.log")
stderr_path "log/unicorn.stderr.log"
stdout_path "log/unicorn.stdout.log"
preload_app true
if GC.respond_to?(:copy_on_write_friendly=)
GC.copy_on_write_friendly = true
end
before_fork do |server, worker|
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
old_pid = "#{server.config[:pid]}.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
sig = (worker.nr + 1) >= server.worker_processes ? :TERM : :TTOU
Process.kill(sig, File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job …Run Code Online (Sandbox Code Playgroud) 我试图用Apache2和ruby 2.0安装乘客,当我这样做时我遇到了这样的错误:
passenger-install-apache2-module
Run Code Online (Sandbox Code Playgroud)
错误:
--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/local/lib/ruby/gems/2.0.0/gems/passenger-3.0.19
/usr/local/bin/ruby /usr/local/bin/rake apache2:clean apache2 RELEASE=yes
# /usr/local/bin/ruby /usr/local/bin/rake apache2:clean apache2 RELEASE=yes
rake aborted!
cannot load such file -- rubygems/builder
(See full trace by running task with --trace)
--------------------------------------------
It looks like something went wrong
Run Code Online (Sandbox Code Playgroud)
我试过了:
gem install builder
Run Code Online (Sandbox Code Playgroud)
但是这个错误仍然会发生.我该如何解决?
编辑
Ruby版本:
2.0 p2
Run Code Online (Sandbox Code Playgroud)
宝石清单:
bigdecimal (1.2.0)
builder (3.2.0)
bundler (1.3.1)
daemon_controller (1.1.1)
fastthread (1.0.7)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
passenger (3.0.19)
psych (2.0.0)
rack (1.5.2)
rack-protection …Run Code Online (Sandbox Code Playgroud) 我试着按照这个指南
当我想在运行此命令后继续学习本教程时:
sudo apt-get install nginx-extras passenger
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
passenger is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies: …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Dreamhost共享服务器上运行Ruby on Rails应用程序.到目前为止一切都很好,除了一个我无法解开的奇怪的错误.
有时当我访问网络应用程序时,我收到一个Phusion Passenger错误说,
您已经激活了机架1.2.1,但您的Gemfile需要机架1.2.2.考虑使用bundle exec.
当我只是刷新页面时,它似乎工作,但没有更多的Phusion Passenger错误消息.
在其他堆栈溢出线程和类似的Dreamhost wiki之后,我将以下内容添加到config/environment.rb文件的顶部:
if ENV['RAILS_ENV'] == 'production' # don't bother on dev
ENV['GEM_PATH'] = '/home/myusername/.gems' + ':/usr/lib/ruby/gems/1.8'
end
Run Code Online (Sandbox Code Playgroud)

为Phusion Passenger安装的Apache模块在哪里?我想调整" 配置Phusion Passenger "中的一些配置值.
我不知道这个配置文件在哪里.我安装了Nginx文档所说的一切.
我正在尝试使用apache2和mod_rails(Phusion Passenger)在ubuntu10.10上的rails服务器上设置ruby.
我已经安装了ruby 1.9.2-p0和rails 3.0.8,并使用passenger-install-apache2-module和passenger gem(v3.0.7)安装了Passenger.
然后它告诉我在我的Apache配置文件中添加3行.所以我将这些行添加到'/etc/apache2/apache2.conf'中:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/gems/1.9.1/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby
Run Code Online (Sandbox Code Playgroud)
我编辑了我的'/etc/apache2/httpd.conf'并添加了:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 192.168.0.2
DocumentRoot /var/www/webop/public
<Directory /var/www/webop/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我还发现/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/ext/apache2/中的文件mod_passenger.so实际上不存在,其名称为mod_passenger.c.但我没有从中得到任何错误.
服务器只能通过LAN访问.当我访问服务器时,我看到我的应用程序的公共文件夹中的所有文件和目录,但应用程序本身没有开始.
当我重新启动apache它告诉我mod_rails已经加载所以我猜这个乘客正在运行,但我无法弄清楚为什么它不启动我的应用程序!
提前致谢!
我感到困惑,是否在服务器上,你应该安装RVM作为一个普通用户或做全系统的安装,并且,如果是后者,你应该怎么做这样的事情bundle install,而不使用sudo.
就RVM是否涉及运行Rails的服务器(如Passenger和Nginx)而言,是否有任何明确的指导方针可以解决您的问题?在这种类型的环境中,并非所有Ruby进程都在同一个用户下运行,所以我认为就RVM和Bundler而言,事情变得不明确.
如何在服务器上一起避免使用RVM,只需在那里安装Ruby和gems?如果你可以逃脱它,那会更好吗?