【问题标题】:error deploying a rails app to google cloud将 Rails 应用程序部署到谷歌云时出错
【发布时间】:2020-02-21 15:29:19
【问题描述】:

我正在尝试将 Rails 应用程序部署到谷歌云,请关注 tutorial。该应用程序使用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)

有人知道我该如何解决吗?

谢谢!

【问题讨论】:

    标签: ruby-on-rails google-cloud-platform


    【解决方案1】:

    您的错误似乎与库dry-types 有关。根据错误:

    [dry-types] Dry::Types.module 已弃用,将在下一个主要版本中删除

    似乎正在使用的这个版本将被删除,您需要更新它。我建议您尝试一下并检查一下,因为这似乎会影响 Rails,Google Cloud Platform 正在使用它来部署您的应用程序。

    关于dry-types的更多信息可以在图书馆的Github存储库here找到

    如果这些信息对您有帮助,请告诉我!

    【讨论】:

      猜你喜欢
      • 2015-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-22
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      相关资源
      最近更新 更多