首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

rails使用thin服务器异常

2012-12-26 
rails使用thin服务器错误在使用rails启动thin服务器是出现错误如下:/Library/Ruby/Gems/1.8/gems/rack-1.4

rails使用thin服务器错误

在使用rails启动thin服务器是出现错误

如下:

/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': no such file to load -- thin (LoadError)

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/thin.rb:1

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:269:in `inject'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'

from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'

from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands/server.rb:59:in `start'

from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:55

from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'

from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50

from ./script/rails:6:in `require'

from ./script/rails:6

?

解决方法:

在rails所创建的文件Gemfile中添加上如下:

gem 'thin'

保存后重新启动:

./script/rails s thin=> Booting Thin=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000=> Call with -d to detach=> Ctrl-C to shutdown server>> Thin web server (v1.5.0 codename Knife)>> Maximum connections set to 1024>> Listening on 0.0.0.0:3000, CTRL+C to stop
?

?

热点排行