我已经rvm
提前安装了。我决定从一个包(nginx-full 和 Passenger)安装乘客,并希望使用ruby
安装的 with rvm
。但不知何故,它不起作用。sinatra
这是我正在使用的测试应用程序( ~yuri/a1/app.rb
):
require 'rubygems'
require 'sinatra'
get '/' do
"Hello and Goodbye"
end
〜尤里/a1/config.ru:
require 'rubygems'
require 'sinatra'
require './app.rb'
run Sinatra::Application
nginx.conf:
http {
...
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
# the paths in the above file point out to debian repository's ruby version
server {
server_name a1;
root /home/yuri/a1;
access_log /var/log/nginx/a1-access.log;
error_log /var/log/nginx/a1-error.log;
passenger_enabled on;
passenger_ruby /home/yuri/.rvm/wrappers/ruby-1.9.3-p385@a1/ruby;
}
}
但是当我w3m http://a1
access.log
说:
127.0.0.1 - - [12/Sep/2013:21:14:58 +0300] "GET / HTTP/1.0" 403 168 "-" "w3m/0.5.2+cvs-1.1027"
和error.log
:
2013/09/12 21:14:58 [error] 27622#0: *1 directory index of "/home/yuri/tr/" is forbidden, client: 127.0.0.1, server: tr, request: "GET / HTTP/1.0", host: "a1"
如果我按如下方式运行该应用程序,则该应用程序可以工作:rvm ruby-1.9.3-p385@a1 && ruby app.rb
.
有没有办法追踪那里发生的事情?或者如何让它发挥作用?