rails g airbrake
で生成した設定ファイルや、Errbit のアプリ登録後の画面には c.host = 'http://xxx.vs.sakura.ne.jp'
のように表示されているので、最後にスラッシュをつけない流儀に合わせてサブディレクトリを書いたらとてもはまりました。
正しくは、次のように最後にスラッシュをつけるのが正しいです。そうしないと /errbit/api の形になってくれません。
config/initializers/airbrake.rb
Airbrake.configure do |c|
c.host = 'http://xxx.vs.sakura.ne.jp/errbit/'
c.project_id = 1
c.project_key = 'xxxxxxxxxxxxxxxx'
end
該当個所のコード検証
スラッシュをつけないとこの2つ目のように /foo がなかったことになってしまう。
require "uri"
URI.join("http://example.net", "api").to_s # => "http://example.net/api"
URI.join("http://example.net/foo", "api").to_s # => "http://example.net/api"
URI.join("http://example.net/foo/", "api").to_s # => "http://example.net/foo/api"