如何使用ruby启动瘦服务器? require':无法加载此类文件 - 应用程序(LoadError)

时间:2023-01-19 14:51:23

I want to start my app using thin server

我想使用瘦服务器启动我的应用程序

In config.ru

require 'sinatra'

require 'app'
run Sinatra.application

they are on the same directory

它们位于同一目录中

kithokit@19:05:26 hello (master) $ ls config.ru app.rb 
app.rb  config.ru

but i still got this error

但我仍然有这个错误

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'

1 个解决方案

#1


1  

Change this line

改变这一行

require 'app'

to

require './app'

for more alternatives also see: Why does Ruby 1.9.2 remove "." from LOAD_PATH, and what's the alternative?

有关更多替代方案,请参阅:为什么Ruby 1.9.2删除“。”来自LOAD_PATH,还有什么选择?

#1


1  

Change this line

改变这一行

require 'app'

to

require './app'

for more alternatives also see: Why does Ruby 1.9.2 remove "." from LOAD_PATH, and what's the alternative?

有关更多替代方案,请参阅:为什么Ruby 1.9.2删除“。”来自LOAD_PATH,还有什么选择?