【发布时间】:2020-02-02 14:10:28
【问题描述】:
我有一个带有 Vue 前端和 Rails 后端的项目。它只是后端的一个非常简单的 API,没有数据库或任何东西。它在本地运行良好,但现在我想在 Heroku 上部署它。
但是,当我运行它时,我收到以下错误。
-----> Detecting rake tasks
!
! Could not detect rake tasks
! ensure you can run `$ bundle exec rake -P` against your app
! and using the production group of your Gemfile.
! rake aborted!
! URI::InvalidURIError: bad URI(is not URI?): ://user:pass@127.0.0.1/dbname
...
...
/activerecord-6.0.2.1/lib/active_record/railties/databases.rake
根据各种 SO 帖子/Heroku 文档,我已经尝试过:
-
bundle exec rake -P RAILS_ENV=production- 一切正常 - 在 Gemfile 中添加
rake依赖项 - 移除 Gemfile 中的
sqlite依赖项 - 从 Gemfile.lock 中删除 BUNDLED WITH
但还是同样的错误。
我猜这与我的数据库配置有关,但我的项目中没有任何数据库,所以这似乎是一项不必要的任务。我尝试从我的 Gemfile 中注释掉 railties,但它仍然作为其他 gem 的依赖项存在。当我在进行此更改后进行部署时,它仍然会执行相同的任务并失败。
链接到repo branch
【问题讨论】:
标签: ruby-on-rails heroku railtie