heroku运行错误,错误的URI

时间:2013-12-08 17:35:07

标签: heroku ruby-on-rails-4

我可以在我的本地mac pc上运行该应用程序。 但是当我运行heroku时,我遇到了这个错误。但我不知道......

zzz-ui-MacBook-Pro:backend zzz$ heroku run bundle exec rails console

Running `bundle exec rails console` attached to terminal... up, run.7525
Connecting to database specified by DATABASE_URL
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(is not URI?):  (URI::InvalidURIError)
    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:211:in `parse'
    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
    from /app/vendor/bundle/ruby/2.0.0/gems/sentry-raven-0.6.0/lib/raven/configuration.rb:96:in `server='
    from /app/config/initializers/raven.rb:5:in `block in <top (required)>'
    from /app/vendor/bundle/ruby/2.0.0/gems/sentry-raven-0.6.0/lib/raven.rb:62:in `configure'
    from /app/config/initializers/raven.rb:4:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `block in load'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `each'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `block in <class:Engine>'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /app/config/environment.rb:5:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:103:in `require_environment!'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/commands.rb:40:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

请帮帮我。 谢谢〜!!

2 个答案:

答案 0 :(得分:3)

错误来自:

config/initializers/raven.rb

看起来它与sentry-raven gem有关,基于其上方的堆栈跟踪线。您应该检查该gem的文档,并确保该初始化程序中的任何代码以及任何环境变量都适用于heroku上的生产环境。

答案 1 :(得分:0)

检查您的配置变量,尤其是DATABASE_URL here。还要验证你是否使用了Postgres,Mongo,Neo4J或其他任何你使用的Heroku附加组件,而不是自己连接任何东西。