rails root的独角兽错误

时间:2012-09-15 11:32:56

标签: ruby-on-rails nginx unicorn

我正在使用Rails 3.2.6创建一个rails应用程序。 我想连接unicorn和nginx,但是我遇到以下错误:

/path/to/home/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/configurator.rb:492:in `working_directory': config_file=unicorn.conf.minimal.rb would not be accessible in working_directory=/path/to/rails/app (ArgumentError)

我认为我的配置文件有误,但是如何使用它们?

我使用此unicorn.conf.minimal.rb

working_directory "/path/to/rails/app"
listen "/path/to/app/tmp/sockets/unicorn.sock", :backlog => 64
listen 8080 # by default Unicorn listens on port 8080
worker_processes 2 # this should be >= nr_cpus
pid "/home/paisen/shour_teaser/config/unicorn/pids/unicorn.pid"
stderr_path "/path/to/rails/app/config/unicorn/log/stderr.log"
stdout_path "/path/to/rails/app/config/unicorn/log/stdout.log"

2 个答案:

答案 0 :(得分:2)

请参阅would not be accessible字样,可能是权限问题,请查看您的登录用户。

但可能是配置结果。

所以你认为my config files are wronghere是Nginx + Unicorn最佳实践的会话指南。

答案 1 :(得分:2)

我知道这有点陈旧,但我碰到了这个问题,我的unicorn.rb working_directory指向了错误的位置。修好之后就开始了。这是在ubuntu 12.04服务器上

bundle exec unicorn -c config/unicorn.rb -D