我想使用瘦服务器启动我的应用
在config.ru中
require 'sinatra'
require 'app'
run Sinatra.application
他们在同一个目录
kithokit@19:05:26 hello (master) $ ls config.ru app.rb
app.rb config.ru
但我仍然遇到此错误
kithokit@19:05:14 meet-api (master) $ thin start
Using rack adapter
/home/kithokit/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- app (LoadError)
from /home/kithokit/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
答案 0 :(得分:1)
更改此行
require 'app'
到
require './app'
有关更多替代方案,请参阅:Why does Ruby 1.9.2 remove "." from LOAD_PATH, and what's the alternative?