在Rails 3上安装/运行瘦Web服务器3

问题描述:

运行“瘦”Web服务器时遇到问题。它看起来像安装是成功的,但是当我运行“精简启动”时,它看起来像Thin开始初始化,但是然后找不到它需要的一些资源。在Rails 3上安装/运行瘦Web服务器3

下面是我的终端会话中的审计线索。有人可以提供这个手吗?根据Thin文档,安装正确完成。由于

的Rails 3.2.12
红宝石1.9.3

[email protected]:/var/www/testapp# gem install thin 

Fetching: eventmachine-1.0.0.gem (100%) 
Building native extensions. This could take a while... 
Fetching: daemons-1.1.9.gem (100%) 
Fetching: thin-1.5.0.gem (100%) 
Building native extensions. This could take a while... 
Successfully installed eventmachine-1.0.0 
Successfully installed daemons-1.1.9 
Successfully installed thin-1.5.0 
3 gems installed 



[email protected]:/var/www/testapp# thin start 
>> Using rack adapter 
>> Thin web server (v1.5.0 codename Knife) 
>> Maximum connections set to 1024 
>> Listening on 0.0.0.0:3000, CTRL+C to stop 

/usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/backends /tcp_server.rb:16:in `connect': cannot load such file -- thin/connection (LoadError) 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/backends/base.rb:55:in `block in start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/server.rb:159:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/thin-1.5.0/bin/thin:6:in `<top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/bin/thin:19:in `load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/bin/thin:19:in `<main>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval' 
    from /usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>' 
+0

'轨s'作品? – 2013-02-14 12:49:40

+0

是的,当我做“rails s”时,webrick启动正常 – Slinky 2013-02-14 12:52:33

+1

是否将它添加到gemfile中? – 2013-02-14 13:05:49

你好像瘦安装独立于轨道

它添加到您的Gemfile,你应该罚款

尝试执行以下命令:

cd to/your/rails /应用

回声 '宝石 “薄”' >>的Gemfile

薄开始

https://github.com/macournoyer/thin/issues/115

此内容如果您想使用的宝石,它必须是在你的Gemfile。

  • 以下行添加到您的的Gemfilegem 'thin'
  • 更新您的当前应用程序的环境:可以按如下方式解决你的问题bundle install
  • 然后启动服务器