`виноградный сервер` выдает ошибку `невозможно загрузить такой файл -- виноград`, даже если виноград установлен

Я работаю внештатно над проектом Grape API, не относящимся к Rails, и при запускеgrape serverЯ сталкиваюсь с вышеуказанной ошибкой. Я вставил трассировку стека ниже. Кажется, проблема в том, что Rack не может найти путь к драгоценному камню, но я не знаю, как устранить неполадки.bundleработает, как и ожидалось, и когда я используюgem info grapeэто указывает на~/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0

      reed@reed-desktop:~/dev/project$ grape s
Starting Grape server...
Traceback (most recent call last):
        19: from /home/reed/.rbenv/versions/2.7.6/bin/rackup:23:in `<main>'
        18: from /home/reed/.rbenv/versions/2.7.6/bin/rackup:23:in `load'
        17: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/bin/rackup:4:in `<top (required)>'
        16: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:141:in `start'
        15: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:250:in `start'
        14: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
        13: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
        12: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
        11: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
        10: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
         9: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
         8: from /home/reed/dev/tts-converter/config.ru:in `<main>'
         7: from /home/reed/dev/tts-converter/config.ru:in `new'
         6: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
         5: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
         4: from /home/reed/dev/tts-converter/config.ru:3:in `block in <main>'
         3: from /home/reed/dev/tts-converter/config.ru:3:in `require_relative'
         2: from /home/reed/dev/tts-converter/adalo_text_to_speech.rb:3:in `<top (required)>'
         1: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
/home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- grape (LoadError)
        57: from /home/reed/.rbenv/versions/2.7.6/bin/rackup:23:in `<main>'
        56: from /home/reed/.rbenv/versions/2.7.6/bin/rackup:23:in `load'
        55: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/bin/rackup:4:in `<top (required)>'
        54: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:141:in `start'
        53: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:250:in `start'
        52: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
        51: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
        50: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
        49: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
        48: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
        47: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
        46: from /home/reed/dev/tts-converter/config.ru:in `<main>'
        45: from /home/reed/dev/tts-converter/config.ru:in `new'
        44: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
        43: from /home/reed/.gem/ruby/2.7.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
        42: from /home/reed/dev/tts-converter/config.ru:3:in `block in <main>'
        41: from /home/reed/dev/tts-converter/config.ru:3:in `require_relative'
        40: from /home/reed/dev/tts-converter/adalo_text_to_speech.rb:3:in `<top (required)>'
        39: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:147:in `require'
        38: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `rescue in require'
        37: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `require'
        36: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape.rb:230:in `<top (required)>'
        35: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        34: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        33: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/validators/base.rb:3:in `<top (required)>'
        32: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/validators/base.rb:4:in `<module:Grape>'
        31: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        30: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        29: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations.rb:7:in `<top (required)>'
        28: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        27: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        26: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types.rb:3:in `<top (required)>'
        25: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types.rb:3:in `require_relative'
        24: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types/build_coercer.rb:3:in `<top (required)>'
        23: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types/build_coercer.rb:3:in `require_relative'
        22: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types/array_coercer.rb:3:in `<top (required)>'
        21: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types/array_coercer.rb:3:in `require_relative'
        20: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/grape-1.6.2/lib/grape/validations/types/dry_type_coercer.rb:3:in `<top (required)>'
        19: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        18: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        17: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry-types.rb:3:in `<top (required)>'
        16: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        15: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        14: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types.rb:19:in `<top (required)>'
        13: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        12: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
        11: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/nominal.rb:209:in `<top (required)>'
        10: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
         9: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
         8: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/hash.rb:137:in `<top (required)>'
         7: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
         6: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:94:in `require'
         5: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:5:in `<top (required)>'
         4: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:6:in `<module:Dry>'
         3: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:21:in `<module:Types>'
         2: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/schema.rb:22:in `<class:Schema>'
         1: from /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-types-1.5.1/lib/dry/types/fn_container.rb:20:in `register'
/home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/dry-container-0.11.0/lib/dry/container/mixin.rb:225:in `key?': undefined method `key?' for nil:NilClass (NoMethodError)

Вот результатgem env.

      reed@reed-desktop:~/dev/project$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.6
  - RUBY VERSION: 2.7.6 (2022-04-12 patchlevel 219) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /home/reed/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /home/reed/.rbenv/versions/2.7.6/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/reed/.rbenv/versions/2.7.6/bin
  - SPEC CACHE DIRECTORY: /home/reed/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/reed/.rbenv/versions/2.7.6/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/reed/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0
     - /home/reed/.gem/ruby/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/reed/.rbenv/versions/2.7.6/bin
     - /home/reed/.rbenv/libexec
     - /home/reed/.rbenv/plugins/ruby-build/bin
     - /home/reed/.rbenv/shims
     - /home/reed/.rbenv/bin
     - /bin/bash
     -  line 1
     -  /home/reed/.zshrc
     -  No such file or directory
/home/reed/bin
     - /home/reed/.rbenv/shims
     - /home/reed/.rbenv/bin
     - /home/reed/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin
     - /snap/bin

1 ответ

Решил эту проблему взбиваниемrbenvиз моей системы, удалив и переустановив все рубиновые версии и драгоценные камни. Не знаю в чем была проблема, но хард ресет решил.

Другие вопросы по тегам