Ruby on rails 无法使用-d开关启动rails服务器

Ruby on rails 无法使用-d开关启动rails服务器,ruby-on-rails,Ruby On Rails,我正在尝试使用-d开关作为守护进程启动rails服务器。我已经安装了瘦服务器,正在Ubuntu上工作。如果作为正常进程启动,它会工作,但当使用-d开关时,它会抱怨服务器pid文件/tmp/pids/server.pid 即使我删除文件并尝试使用-d开关启动服务器,它也不会启动。请帮忙 错误显示: /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have a

我正在尝试使用
-d
开关作为守护进程启动rails服务器。我已经安装了瘦服务器,正在Ubuntu上工作。如果作为正常进程启动,它会工作,但当使用
-d
开关时,它会抱怨服务器pid文件
/tmp/pids/server.pid

即使我删除文件并尝试使用
-d
开关启动服务器,它也不会启动。请帮忙

错误显示:

/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated daemons 1.1.9, but your Gemfile requires daemons 1.1.8. Using bundle exec may solve this. (Gem::LoadError)

        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
        from /home/ubuntu/deploys/releases/20131001113746/config/boot.rb:6:in `<top (required)>'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /home/ubuntu/deploys/releases/20131001113746/config/application.rb:1:in `<top (required)>'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /home/ubuntu/deploys/releases/20131001113746/config/environment.rb:2:in `<top (required)>'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
        from /home/ubuntu/deploys/releases/20131001113746/config.ru:3:in `block in <main>'
        from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
        from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
        from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `new'
        from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `<main>'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:42:in `for'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:73:in `start'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
        from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
        from /usr/bin/thin:23:in `load'
        from /usr/bin/thin:23:in `<main>'
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:在“设置中的块”:您已经激活了守护程序1.1.9,但您的Gemfile需要守护程序1.1.8。使用bundle exec可以解决这个问题。(Gem::LoadError)
from/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in'setup'
from/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in'setup'
来自/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in`'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:110:in'require'
来自/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:110:in'rescue in require'
来自/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:35:in'require'
from/home/ubuntu/deploys/releases/20131001113746/config/boot.rb:6:in`'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/home/ubuntu/deploys/releases/20131001113746/config/application.rb:1:in`'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/home/ubuntu/deploys/releases/20131001113746/config/environment.rb:2:in`'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/usr/local/lib/site\u ruby/1.9.1/rubygems/core\u ext/kernel\u require.rb:45:in'require'
from/home/ubuntu/deploys/releases/20131001113746/config.ru:3:in'block in'
from/usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in'instance_eval'
from/usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in'initialize'
from/home/ubuntu/deploys/releases/20131001113746/config.ru:1:in'new'
from/home/ubuntu/deploys/releases/20131001113746/config.ru:1:in`'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in'eval'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in'load'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:42:in'for'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:169:in'load_adapter'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:73:in'start'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in'run_命令'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in'run!'
from/usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/bin/thin:6:in`'
from/usr/bin/thin:23:in'load'
from/usr/bin/thin:23:in`'

在开始时使用“bundle exec”运行服务器,如下所示:

bundle exec rails s -d

或者,异常跟踪说明激活的守护进程不匹配。要解决此问题,请将守护进程gem的版本设置为大于(而不是等于)1.1.8,然后重试

确保rails服务器可以访问/tmp目录?错误消息是什么?请尝试以下操作: