0

我尝试使用Heroku为我的 RoR 应用程序设置Errbit (Airbrake) ,遵循以下站点:

Heroku 上的部署运行良好。我可以正常登录并创建应用程序,所有设置似乎都可以。

在应用程序方面,我按照指南中的描述创建了文件:

*Gemfile:*
gem 'airbrake'

*config/initializers/errbit.rb:*    
Airbrake.configure do |config|
  config.api_key = 'eb81f59f77778865464da97f0e1ce5951'
  config.host    = 'myproject-errbit.herokuapp.com'
  config.port    = 80
  config.secure  = config.port == 443
end

我运行“捆绑安装”并在 localhost 中尝试了命令:

rake airbrake:test

好的,它可以工作(heroku 应用程序中存在的信息)。接下来,我在生产环境中部署(通过 capistrano),然后再试一次:

 ssh app@xx.xxx.xxx.xxx
 cd /u/myapp/path/current/
 rake airbrake:test

我收到此错误消息:

/home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find i18n-0.6.5 in any of the sources (Bundler::GemNotFound)
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/rubygems-bundler-1.3.4/lib/rubygems-bundler/noexec.rb:74:in `setup'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/rubygems-bundler-1.3.4/lib/rubygems-bundler/noexec.rb:103:in `check'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/rubygems-bundler-1.3.4/lib/rubygems-bundler/noexec.rb:109:in `<top (required)>'
        from /home/app/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
        from /home/app/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
        from /home/app/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/rubygems-bundler-1.3.4/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/executable-hooks-1.2.3/lib/executable-hooks/hooks.rb:50:in `call'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/executable-hooks-1.2.3/lib/executable-hooks/hooks.rb:50:in `block in run'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/executable-hooks-1.2.3/lib/executable-hooks/hooks.rb:49:in `each'
        from /home/app/.rvm/gems/ruby-2.0.0-p0@global/gems/executable-hooks-1.2.3/lib/executable-hooks/hooks.rb:49:in `run'
        from /home/app/.rvm/gems/ruby-2.0.0-p0/bin/ruby_executable_hooks:10:in `<main>'

(我已经使用“app”用户(部署用户)输入了命令。)

我觉得红宝石设置是错误的:

ruby version
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]

rvm list
rvm rubies

=* ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

所以你可以想象,当发生错误时,数据不会保存在 Errbit(Heroku) 项目中。

如果有人可以帮助我,我将不胜感激~

感谢您的阅读。

4

1 回答 1

2

这是因为您需要在捆绑器环境中启动 rake。尝试 :

bundle exec rake airbrake:test

于 2013-10-29T13:16:05.720 回答