我正在尝试将我的应用程序上传到heroku,现在它只是纯粹的设计而不需要数据库连接。上传时我一直收到此错误。
Your bundle is complete!
remote: Gems in the groups development and test were not installed.
remote: It was installed into ./vendor/bundle
remote: Bundle completed (1.06s)
remote: Cleaning up the bundler cache.
remote: Could not detect rake tasks
remote: ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
remote: and using the production group of your Gemfile.
remote: rake aborted!
remote: URI::InvalidURIError: bad URI(is not URI?): ://user:pass@127.0.0.1/dbname
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:176:in `split'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:211:in `parse'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/ruby-2.0.0/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:35:in `initialize'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:279:in `new'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:279:in `resolve_url_connection'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:242:in `resolve_string_connection'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:267:in `resolve_hash_connection'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:228:in `resolve_connection'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:152:in `resolve'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:164:in `block in resolve_all'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:163:in `each'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:163:in `resolve_all'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_handling.rb:69:in `resolve'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/core.rb:46:in `configurations='
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/core.rb:48:in `block in <module:Core>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/concern.rb:120:in `class_eval'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.4/lib/active_support/concern.rb:120:in `append_features'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/base.rb:297:in `include'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/base.rb:297:in `<class:Base>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/base.rb:282:in `<module:ActiveRecord>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/base.rb:23:in `<top (required)>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/railtie.rb:39:in `require'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/railtie.rb:39:in `block in <class:Railtie>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/railtie.rb:237:in `instance_exec'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/railtie.rb:237:in `block in run_tasks_blocks'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/railtie.rb:245:in `each'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/railtie.rb:245:in `each_registered_block'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/railtie.rb:237:in `run_tasks_blocks'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/application.rb:373:in `block in run_tasks_blocks'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine/railties.rb:13:in `each'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine/railties.rb:13:in `each'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/application.rb:373:in `run_tasks_blocks'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/railties-4.1.4/lib/rails/engine.rb:449:in `load_tasks'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/Rakefile:6:in `<top (required)>'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
remote: /tmp/build_1f483b69aed84c97fc81983578b0b4e9/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
remote: vendor/bundle/bin/rake:16:in `load'
remote: vendor/bundle/bin/rake:16:in `<main>'
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 30.6MB
remote: -----> Launching... done, v14
remote: https://teknolohiya.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/teknolohiya.git
897dd11..5ac0b58 master -> master
它完成并说上传已完成,但在尝试检查它显示的应用程序时 应用程序错误 应用程序中发生错误,无法提供您的页面。请稍后再试。
如果您是应用程序所有者,请查看日志以获取详细信息。
的routes.rb
Rails.application.routes.draw do
#root
root 'home#index'
#welcome
get 'welcome' => 'welcome#index'
#about
get 'about' => 'about#index'
#contact
get 'contact' => 'contact#index'
end
答案 0 :(得分:2)
我刚遇到这个问题,也许不是问题,但问题是Heroku试图调用DATABASE_URL。我配置了一个免费的postgres数据库(即使我们没有将它用于项目)并且能够解决这个问题。
答案 1 :(得分:0)
检查日志(heroku日志) 使用Google Chrome开发人员工具检查网络响应(右键单击,检查元素)。
我正在看这个错误
URI::InvalidURIError: bad URI(is not URI?): ://user:pass@127.0.0.1/dbname
我猜它会与你的路线有关。显示您的routes.rb文件您是否说明了您网站的根目录?
root 'welcome#index'