我有一个现有的 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:[email protected]/dbname
...
...
/activerecord-6.0.2.1/lib/active_record/railties/databases.rake
为了复制skip-active-record
在现有项目中进行设置,请按照以下步骤操作这个答案
PLUS
REMOVE 配置/环境/development.rb -> config.active_storage.service = :local
REMOVE 配置/环境/生产.rb -> config.active_storage.service = :local
REMOVE 配置/环境/test.rb -> config.active_storage.service = :local
REMOVE 垃圾箱/设置 -> puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
DELETE 配置/存储.yml
REMOVE 测试/test_helper.rb # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)