Chr*_*s A 3 ruby-on-rails ruby-on-rails-6
我有一个现有的 Rails 项目,它是在 API 模式下创建的,不使用数据库。在尝试部署到 Heroku 时,我收到许多与 ActiveRecord 相关的错误。
-----> 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
Run Code Online (Sandbox Code Playgroud)
要在现有项目中复制设置,请按照此答案skip-active-record中的步骤操作
加
删除config/environments/development.rb ->config.active_storage.service = :local
删除配置/环境/生产.rb - >config.active_storage.service = :local
删除config/environments/test.rb ->config.active_storage.service = :local
删除垃圾箱/设置-> puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
删除配置/存储.yml
删除测试/test_helper.rb # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
| 归档时间: |
|
| 查看次数: |
2818 次 |
| 最近记录: |