Sinatra::Application.environment に staging が追加できなくてもやもやしてたら
NG
require 'sinatra/base'
require 'sinatra/config_file'
class MyApp < Sinatra::Base
set :root, File.dirname(__FILE__)
set :environments, %w{development test production staging}
register Sinatra::ConfigFile
config_file 'path/to/config.yml'
get '/' do
settings.hello
end
end
OK
require 'sinatra/base'
require 'sinatra/config_file'
class MyApp < Sinatra::Base
register Sinatra::ConfigFile
set :root, File.dirname(__FILE__)
set :environments, %w{development test production staging}
config_file 'path/to/config.yml'
get '/' do
settings.hello
end
end
orz
うそやん......
ちなみに、NGのほうをそのまま実行すると
undefined method `hello' for MyApp:Class (NoMethodError)
的なエラーメッセージになります。。