ruby-on-rails - 将 Rails 应用程序部署到谷歌云时出错
问题描述
我正在尝试按照本教程将 Rails 应用程序部署到谷歌云。该应用程序使用postresql
数据库。在部署新版本的步骤中,我必须运行以下命令:
bundle exec bin/rails assets:precompile
但我收到了这个错误:
[dry-types] Dry::Types.module is deprecated and will be removed in the next major version
Use Dry.Types() instead. Beware, it exports strict types by default, for old behavior use Dry.Types(default: :nominal). See more options in the changelog
/home/<user>/.rvm/rubies/ruby-2.4.9/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `require'
rails aborted!
NoMethodError: undefined method `member_types' for #<Dry::Types::Hash::Constructor:0x0000562258ee3c18>
/home/<user>/.rvm/gems/ruby-2.4.9/gems/dry-types-0.15.0/lib/dry/types/constructor.rb:147:in `method_missing'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:306:in `schema'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:193:in `check_schema_duplication'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:133:in `attributes'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:113:in `attribute'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types/sentence.rb:8:in `<class:Sentence>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types/sentence.rb:3:in `<module:Types>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types/sentence.rb:2:in `<module:TranslatorText>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types/sentence.rb:1:in `<top (required)>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types.rb:30:in `require_relative'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator_text/types.rb:30:in `<top (required)>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator-text.rb:4:in `require_relative'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/translator-text-0.1.0/lib/translator-text.rb:4:in `<top (required)>'
/home/<user>/projects/consul/config/application.rb:7:in `<top (required)>'
/home/<user>/projects/consul/Rakefile:4:in `require'
/home/<user>/projects/consul/Rakefile:4:in `<top (required)>'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/railties-5.0.7.2/lib/rails/commands/rake_proxy.rb:13:in `block in run_rake_task'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/railties-5.0.7.2/lib/rails/commands/rake_proxy.rb:11:in `run_rake_task'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:51:in `run_command!'
/home/<user>/.rvm/gems/ruby-2.4.9/gems/railties-5.0.7.2/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<top (required)>'
/home/<user>/.rvm/rubies/ruby-2.4.9/bin/bundle:30:in `block in <main>'
/home/<user>/.rvm/rubies/ruby-2.4.9/bin/bundle:22:in `<main>'
/home/<user>/.rvm/gems/ruby-2.4.9/bin/ruby_executable_hooks:24:in `eval'
/home/<user>/.rvm/gems/ruby-2.4.9/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)
有谁知道我该如何解决?
谢谢!
解决方案
看来您的错误与 library 有关dry-types
。根据错误:
[dry-types] Dry::Types.module 已弃用,将在下一个主要版本中删除
似乎正在使用的此版本将被删除,您需要对其进行更新。我建议您尝试一下并检查一下,因为这似乎会影响 Rails,Google Cloud Platform 正在使用它来部署您的应用程序。
更多信息dry-types
可以在图书馆的 Github 存储库中找到
让我知道这些信息是否对您有帮助!
推荐阅读
- matlab - 寻找一种在 MATLAB 中对线形图案进行语义分割的方法
- export-to-csv - 在 GEE 中将像素的比例更改为非正方形尺寸
- linux - 用于过滤输入变量并根据要求进行剪切的 shell 脚本
- php - 将 AES-256-CBC 函数从 PHP 转换为 Node JS
- spring - 如何使用 JPA 查询严格的 IN 子句
- javascript - 打字稿错误在类型上找不到带有“字符串”类型参数的索引签名
- reactjs - 用于电容器存储的定制挂钩
- c++ - 错误:未在此范围内声明“res_ninit”;你的意思是“res_init”吗?
- css - Stylus:如何使用 Mixin 插值创建 CSS 变量
- c# - Selenium - 开始你的普通铬而不是铬