简体   繁体   English

无法运行 ruby​​ 控制台

[英]Unable to run ruby console

I am attempting to follow a graphql rails tutorial and I'm running into some issues.我正在尝试遵循 graphql rails 教程,但遇到了一些问题。 I'm very new to rails, and generally don't have this many issues.我对 Rails 很陌生,通常没有这么多问题。 From the research I've done it may be an issue with Ruby 2.6+ however, none of the other solutions have worked for me.从我所做的研究来看,它可能是 Ruby 2.6+ 的问题,但是,其他解决方案都没有为我工作。

  • Ruby Version: 2.6.5红宝石版本:2.6.5
  • Rails Version: 6.0.1导轨版本:6.0.1
  • OS: Manjaro 5.3.15操作系统:Manjaro 5.3.15

Stacktrace:堆栈跟踪:

>rails c
Traceback (most recent call last):
bin/rails: Bootsnap::LoadPathCache::FallbackScan
        74: from bin/rails:4:in `<main>'
        73: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        72: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        71: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        70: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        69: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        68: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        67: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        66: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        65: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/commands.rb:18:in `<main>'
        64: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command.rb:46:in `invoke'
        63: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/base.rb:65:in `perform'
        62: from /home/alexis/.gem/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        61: from /home/alexis/.gem/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        60: from /home/alexis/.gem/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        59: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/commands/console/console_command.rb:101:in `perform'
        58: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
        57: from /home/alexis/.gem/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/actions.rb:22:in `require_application!'
        56: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        55: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        54: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        53: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        52: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        51: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        50: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        49: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        48: from /home/alexis/Documents/rails-tutorial/config/application.rb:20:in `<main>'
        47: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler.rb:114:in `require'
        46: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `require'
        45: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `each'
        44: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `block in require'
        43: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `each'
        42: from /home/alexis/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
        41: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        40: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        39: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        38: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        37: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        36: from /usr/lib/ruby/gems/2.6.0/gems/graphql-1.9.16/lib/graphql.rb:86:in `<main>'
        35: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        34: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        33: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        32: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        31: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        30: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        29: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        28: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        27: from /usr/lib/ruby/gems/2.6.0/gems/graphql-1.9.16/lib/graphql/schema.rb:24:in `<main>'
        26: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        25: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        24: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        23: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        22: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        21: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        20: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        19: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        18: from /usr/lib/ruby/gems/2.6.0/gems/graphql-1.9.16/lib/graphql/schema/member.rb:32:in `<main>'
        17: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        16: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        15: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        14: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        13: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        12: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        11: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        10: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         9: from /usr/lib/ruby/gems/2.6.0/gems/graphql-1.9.16/lib/graphql/schema/member/has_fields.rb:2:in `<main>'
         8: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
         7: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
         6: from /home/alexis/.gem/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
         5: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
         4: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
         3: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         2: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
         1: from /usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/usr/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- irb/ruby-token (LoadError)
>gem list
*** LOCAL GEMS ***

actioncable (6.0.1)
actionmailbox (6.0.1)
actionmailer (6.0.1)
actionpack (6.0.1)
actiontext (6.0.1)
actionview (6.0.1)
activejob (6.0.1)
activemodel (6.0.1)
activerecord (6.0.1)
activestorage (6.0.1)
activesupport (6.0.1)
addressable (2.7.0)
bigdecimal (default: 1.4.1)
bindex (0.8.1)
bootsnap (1.4.5)
builder (3.2.4)
bundler (2.0.2)
byebug (11.0.1)
capybara (3.29.0)
childprocess (3.0.0)
cmath (default: 1.0.0)
concurrent-ruby (1.1.5)
crass (1.0.5)
csv (default: 3.0.9)
date (default: 2.0.0)
dbm (default: 1.0.0)
e2mmap (default: 0.1.0)
erubi (1.9.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
ffi (1.11.3)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
gdbm (default: 2.0.0)
globalid (0.4.2)
graphiql-rails (1.5.0)
graphql (1.9.16, 1.8.13)
i18n (1.7.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (1.2.0, 1.1.0)
jbuilder (2.9.1)
json (default: 2.1.0)
listen (3.1.5)
logger (default: 1.3.0)
loofah (2.4.0)
mail (2.7.1)
marcel (0.3.3)
matrix (default: 0.1.0)
method_source (0.9.2)
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
msgpack (1.3.1)
mutex_m (default: 0.1.0)
nio4r (2.5.2)
nokogiri (1.10.7)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
parslet (1.8.2)
pg (1.1.4)
prime (default: 0.1.0)
psych (default: 3.1.0)
public_suffix (4.0.1)
puma (4.3.1)
rack (2.0.7)
rack-proxy (0.6.5)
rack-test (1.1.0)
rails (6.0.1)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.3.0)
railties (6.0.1)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
regexp_parser (1.6.0)
reline (0.0.7)
rexml (default: 3.1.9)
rss (default: 0.2.7)
ruby_dep (1.5.0)
rubyzip (2.0.0)
sass-rails (6.0.0)
sassc (2.2.1)
sassc-rails (2.1.2)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
selenium-webdriver (3.142.6)
shell (default: 0.7)
spring (2.1.0)
spring-watcher-listen (2.0.1)
sprockets (4.0.0)
sprockets-rails (3.2.1)
sqlite3 (1.4.1)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
thor (0.20.3)
thread_safe (0.3.6)
thwait (default: 0.1.0)
tilt (2.0.10)
tracer (default: 0.1.0)
trollop (2.9.10)
turbolinks (5.2.1)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
web-console (4.0.1)
webdrivers (4.1.3)
webpacker (4.2.2)
webrick (default: 1.4.2)
websocket-driver (0.7.1)
websocket-extensions (0.1.4)
xpath (3.2.0)
yarn (0.1.1)
zeitwerk (2.2.2)
zlib (default: 1.0.0)

Please let me know if there is any other information I can provide.如果我可以提供任何其他信息,请告诉我。 As I said I'm new to Ruby and that includes helpful diagnostic information.正如我所说,我是 Ruby 的新手,其中包括有用的诊断信息。

Looking at the stacktrace, it's definitely an issue with Bootsnap, and it may have to do with the bleeding edge versions of both ruby (2.6.5 - released Oct 1/19) and rails 6.0.1 (released Nov 1/19).查看堆栈跟踪,这绝对是 Bootsnap 的问题,它可能与 ruby​​(2.6.5 - 2019 年 10 月 1 日发布)和 rails 6.0.1(19 年 11 月 1 日发布)的最新版本有关。

Seeing this thread as well, I would suggest downgrading your ruby versions into the 2.5 bloodline and trying again and if you're doing a new tutorial, I'm sure that even a modern version of rails like 5.6.2 would work swimmingly as well.也看到这个帖子,我建议将你的 ruby​​ 版本降级到 2.5 血统,然后再试一次,如果你正在做一个新的教程,我相信即使是像 5.6.2 这样的现代版本的 rails 也能正常工作.

Try RVM or RBenv to install multiple versions/switch between them - it'll make your ruby upgrade/downgrade life quite a bit easier.尝试使用 RVM 或 RBenv 安装多个版本/在它们之间切换 - 这将使您的 ruby​​ 升级/降级生活变得更加轻松。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM