Dér*_*tti 37 ruby rubygems ruby-on-rails
大家早上好。
\n我试图理解下面的错误,但由于我是 Rails 新手,我不太明白。有人知道它可能是什么吗?
\n我在互联网上搜索但没有找到任何具体内容。
\n我在互联网上搜索过,但没有找到任何内容,如果有人看到或有链接,可以发送给我,我会看到。
\n如果您需要更多信息来提供帮助,请告诉我,我将编辑该帖子并添加它,我不知道是否还有其他内容我可以发布。
\n感谢您的帮助 !!
\n\n\xe2\x9e\x9c make up \ndocker-compose up\nStarting XXXXXX_postgres ... done\nStarting XXXXXX_mailcatcher ... done\nStarting XXXXXX_rails ... done\nAttaching to XXXXXX_mailcatcher, XXXXXX_postgres, XXXXXX_rails\nXXXXXX_mailcatcher | Starting MailCatcher\nXXXXXX_mailcatcher | ==> smtp://0.0.0.0:1025\nXXXXXX_postgres | \nXXXXXX_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization\nXXXXXX_postgres | \nXXXXXX_mailcatcher | /usr/local/bundle/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated\nXXXXXX_postgres | 2022-01-21 11:02:46.949 UTC [1] LOG: starting PostgreSQL 12.8 (Debian 12.8-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit\nXXXXXX_mailcatcher | ==> http://0.0.0.0:1080\nXXXXXX_postgres | 2022-01-21 11:02:46.949 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432\nXXXXXX_postgres | 2022-01-21 11:02:46.949 UTC [1] LOG: listening on IPv6 address "::", port 5432\nXXXXXX_postgres | 2022-01-21 11:02:46.954 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"\nXXXXXX_postgres | 2022-01-21 11:02:46.967 UTC [26] LOG: database system was shut down at 2022-01-21 11:02:42 UTC\nXXXXXX_postgres | 2022-01-21 11:02:46.973 UTC [1] LOG: database system is ready to accept connections\nXXXXXX_rails | /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated\nXXXXXX_rails | Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.\nXXXXXX_rails | Traceback (most recent call last):\nXXXXXX_rails | 52: from bin/rails:2:in `<main>'\nXXXXXX_rails | 51: from bin/rails:2:in `load'\nXXXXXX_rails | 50: from /app/bin/spring:7:in `<top (required)>'\nXXXXXX_rails | 49: from /app/bin/spring:7:in `tap'\nXXXXXX_rails | 48: from /app/bin/spring:10:in `block in <top (required)>'\nXXXXXX_rails | 47: from /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'\nXXXXXX_rails | 46: from /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'\nXXXXXX_rails | 45: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/binstub.rb:11:in `<top (required)>'\nXXXXXX_rails | 44: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/binstub.rb:11:in `load'\nXXXXXX_rails | 43: from /usr/local/bundle/gems/spring-3.0.0/bin/spring:49:in `<top (required)>'\nXXXXXX_rails | 42: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/client.rb:30:in `run'\nXXXXXX_rails | 41: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/client/command.rb:7:in `call'\nXXXXXX_rails | 40: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/client/rails.rb:28:in `call'\nXXXXXX_rails | 39: from /usr/local/bundle/gems/spring-3.0.0/lib/spring/client/rails.rb:28:in `load'\nXXXXXX_rails | 38: from /app/bin/rails:4:in `<top (required)>'\nXXXXXX_rails | 37: from /app/bin/rails:4:in `require_relative'\nXXXXXX_rails | 36: from /app/config/boot.rb:4:in `<top (required)>'\nXXXXXX_rails | 35: from /app/config/boot.rb:4:in `require'\nXXXXXX_rails | 34: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/setup.rb:4:in `<top (required)>'\nXXXXXX_rails | 33: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap.rb:112:in `default_setup'\nXXXXXX_rails | 32: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap.rb:70:in `setup'\nXXXXXX_rails | 31: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache.rb:20:in `setup'\nXXXXXX_rails | 30: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/yaml.rb:50:in `install!'\nXXXXXX_rails | 29: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/yaml.rb:55:in `init!'\nXXXXXX_rails | 28: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'\nXXXXXX_rails | 27: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'\nXXXXXX_rails | 26: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'\nXXXXXX_rails | 25: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'\nXXXXXX_rails | 24: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'\nXXXXXX_rails | 23: from /usr/local/lib/ruby/2.7.0/yaml.rb:4:in `<main>'\nXXXXXX_rails | 22: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'\nXXXXXX_rails | 21: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'\nXXXXXX_rails | 20: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'\nXXXXXX_rails | 19: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'\nXXXXXX_rails | 18: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'\nXXXXXX_rails | 17: from /usr/local/lib/ruby/2.7.0/psych.rb:15:in `<main>'\nXXXXXX_rails | 16: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'\nXXXXXX_rails | 15: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'\nXXXXXX_rails | 14: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'\nXXXXXX_rails | 13: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'\nXXXXXX_rails | 12: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'\nXXXXXX_rails | 11: from /usr/local/lib/ruby/2.7.0/psych/nodes.rb:2:in `<main>'\nXXXXXX_rails | 10: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'\nXXXXXX_rails | 9: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'\nXXXXXX_rails | 8: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'\nXXXXXX_rails | 7: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'\nXXXXXX_rails | 6: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'\nXXXXXX_rails | 5: from /usr/local/lib/ruby/2.7.0/psych/nodes/node.rb:2:in `<main>'\nXXXXXX_rails | 4: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'\nXXXXXX_rails | 3: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'\nXXXXXX_rails | 2: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'\nXXXXXX_rails | 1: from /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'\nXXXXXX_rails | /usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': superclass mismatch for class StringIO (TypeError)\nXXXXXX_rails exited with code 1\n\nRun Code Online (Sandbox Code Playgroud)\n这是我的宝石文件
\nsource 'https://rubygems.org'\ngit_source(:github) { |repo| "https://github.com/#{repo}.git" }\n\nruby '2.7.1'\n\ngem 'rails', '~> 6.1.4'\ngem 'pg', '~> 1.1'\ngem 'puma', '~> 5.0'\ngem 'bcrypt', '~> 3.1.7'\ngem 'jwt'\ngem 'simple_command'\ngem "rqrcode", "~> 2.0"\ngem "pundit"\ngem 'rack-cors'\ngem 'active_model_serializers', "~> 0.10.2"\ngem 'kaminari'\ngem 'carrierwave'\ngem 'fog', require: 'fog/aws'\ngem "aws-sdk-s3", require: false\ngem 'mini_magick'\n# Reduces boot times through caching; required in config/boot.rb\ngem 'bootsnap', '>= 1.4.4', require: false\ngem 'paranoia', '~> 2.1'\n\ngroup :development, :test do\n # Call 'byebug' anywhere in the code to stop execution and get a debugger console\n gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]\n gem 'faker'\n gem 'cpf_faker'\n gem "awesome_print", require:"ap"\n gem 'factory_bot_rails'\n gem 'faker'\n gem 'rspec-rails'\nend\n\ngroup :test do\n gem "database_cleaner-active_record", "~> 2.0"\n gem "shoulda-matchers"\n gem "simplecov", "~> 0.21.2", require: false\nend\n\ngroup :development do\n gem 'faker'\n gem 'listen', '~> 3.3'\n # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\n gem 'spring'\nend\n\n# Windows does not include zoneinfo files, so bundle the tzinfo-data gem\ngem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]\nRun Code Online (Sandbox Code Playgroud)\nroot@1:/app# bundler -v\n/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated\nCalling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.\nBundler version 2.1.4\nroot@1:/app# gem list | grep bundl\nbundle (0.0.1)\nbundler (2.3.5, 2.1.4)\nroot@1:/app# \nRun Code Online (Sandbox Code Playgroud)\n
drj*_*nco 75
当我将 Rails 项目中的 Ruby 从 3.0.4 更新到 3.1.2 时,就发生了这种情况。
这为我解决了这个问题:
bundle update --bundler
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你。
Yak*_*kov 19
首先,有关的消息DidYouMean是弃用警告而不是错误,它不会破坏您的应用程序。这意味着 的使用DidYouMean::SPELL_CHECKERS已被弃用,并将在 ruby 的未来版本中删除。在本例中是Ruby 3.3。在您使用低于 3.3 的版本之前,您不必担心这一点。触发警告的不是您的代码。它来自一颗名为托尔的宝石。这个问题在 thor 1.2.0 版本中得到了解决。您可以通过调用 来更新 gem bundle update thor。
实际错误来自bootsnapgem:
/usr/local/bundle/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': superclass mismatch for class StringIO (TypeError)
Run Code Online (Sandbox Code Playgroud)
据我所知,它加载psych宝石并失败。
尝试更新它bundle update bootsnap或删除或检查此处建议的解决方案。
如果它没有帮助,如果您提供bootsnap、psych和stringiogems的版本可能会有所帮助
gem list psych
gem list stringio
gem list bootsnap
Run Code Online (Sandbox Code Playgroud)
或你的Gemfile.lock
| 归档时间: |
|
| 查看次数: |
19257 次 |
| 最近记录: |