gpt4 book ai didi

ruby-on-rails - 由于库版本不兼容,无法创建 Rails 应用程序 - 加载错误

转载 作者:行者123 更新时间:2023-12-04 11:45:21 29 4
gpt4 key购买 nike

第一次在这里发帖!我正在尝试构建一个 rails 应用程序,但我在开始时遇到了很多困难。我已经安装了 Rails 和 Ruby,但是每次我去制作应用程序 (Miless-MBP:railstest miles$ rails new tester2) 时,我都会遇到很多错误。完整日志如下,但我在这里列出了 4 个。

非常感谢大家!

/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `require': cannot load such file -- msgpack/2.6/msgpack (LoadError)

/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `require': incompatible library version - /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack/msgpack.bundle (LoadError)

/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `require': cannot load such file -- msgpack/2.6/msgpack (LoadError)

/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `require': incompatible library version - /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack/msgpack.bundle (LoadError)
    26: from bin/rails:3:in `<main>'
25: from bin/rails:3:in `load'
24: from /Users/miles/railstest/tester2/bin/spring:15:in `<top (required)>'
23: from /Users/miles/railstest/tester2/bin/spring:15:in `require'
22: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
21: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
20: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
19: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
18: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
17: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
16: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
15: from /Users/miles/railstest/tester2/bin/rails:8:in `<top (required)>'
14: from /Users/miles/railstest/tester2/bin/rails:8:in `require_relative'
13: from /Users/miles/railstest/tester2/config/boot.rb:4:in `<top (required)>'
12: from /Users/miles/railstest/tester2/config/boot.rb:4:in `require'
11: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `<top (required)>'
10: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `require_relative'
9: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `<top (required)>'
8: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `require_relative'
7: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
6: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
5: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `<top (required)>'
4: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:40:in `with_gems'
3: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `block in <top (required)>'
2: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `require'
1: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `<top (required)>'
/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `require': cannot load such file -- msgpack/2.6/msgpack (LoadError)
27: from bin/rails:3:in `<main>'
26: from bin/rails:3:in `load'
25: from /Users/miles/railstest/tester2/bin/spring:15:in `<top (required)>'
24: from /Users/miles/railstest/tester2/bin/spring:15:in `require'
23: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
22: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
21: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
20: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
19: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
18: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
17: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
16: from /Users/miles/railstest/tester2/bin/rails:8:in `<top (required)>'
15: from /Users/miles/railstest/tester2/bin/rails:8:in `require_relative'
14: from /Users/miles/railstest/tester2/config/boot.rb:4:in `<top (required)>'
13: from /Users/miles/railstest/tester2/config/boot.rb:4:in `require'
12: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `<top (required)>'
11: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `require_relative'
10: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `<top (required)>'
9: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `require_relative'
8: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
7: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
6: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `<top (required)>'
5: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:40:in `with_gems'
4: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `block in <top (required)>'
3: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `require'
2: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:8:in `<top (required)>'
1: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `rescue in <top (required)>'
/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `require': incompatible library version - /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack/msgpack.bundle (LoadError)
27: from bin/rails:3:in `<main>'
26: from bin/rails:3:in `load'
25: from /Users/miles/railstest/tester2/bin/spring:15:in `<top (required)>'
24: from /Users/miles/railstest/tester2/bin/spring:15:in `require'
23: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
22: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
21: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
20: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
19: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
18: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
17: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
16: from /Users/miles/railstest/tester2/bin/rails:8:in `<top (required)>'
15: from /Users/miles/railstest/tester2/bin/rails:8:in `require_relative'
14: from /Users/miles/railstest/tester2/config/boot.rb:4:in `<top (required)>'
13: from /Users/miles/railstest/tester2/config/boot.rb:4:in `require'
12: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `<top (required)>'
11: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `require_relative'
10: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `<top (required)>'
9: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `require_relative'
8: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
7: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
6: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `<top (required)>'
5: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:39:in `with_gems'
4: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:43:in `rescue in with_gems'
3: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `block in <top (required)>'
2: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `require'
1: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `<top (required)>'
/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:9:in `require': cannot load such file -- msgpack/2.6/msgpack (LoadError)
28: from bin/rails:3:in `<main>'
27: from bin/rails:3:in `load'
26: from /Users/miles/railstest/tester2/bin/spring:15:in `<top (required)>'
25: from /Users/miles/railstest/tester2/bin/spring:15:in `require'
24: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
23: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
22: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
21: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
20: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
19: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
18: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
17: from /Users/miles/railstest/tester2/bin/rails:8:in `<top (required)>'
16: from /Users/miles/railstest/tester2/bin/rails:8:in `require_relative'
15: from /Users/miles/railstest/tester2/config/boot.rb:4:in `<top (required)>'
14: from /Users/miles/railstest/tester2/config/boot.rb:4:in `require'
13: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `<top (required)>'
12: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/setup.rb:1:in `require_relative'
11: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `<top (required)>'
10: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap.rb:3:in `require_relative'
9: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
8: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
7: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `<top (required)>'
6: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:39:in `with_gems'
5: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/explicit_require.rb:43:in `rescue in with_gems'
4: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `block in <top (required)>'
3: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/store.rb:3:in `require'
2: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:8:in `<top (required)>'
1: from /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `rescue in <top (required)>'
/Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack.rb:11:in `require': incompatible library version - /Users/miles/.rvm/gems/ruby-2.6.3/gems/msgpack-1.3.1/lib/msgpack/msgpack.bundle (LoadError)```

最佳答案

我遇到过同样的问题。您需要彻底清理 msgpack gem 使用:

gem uninstall msgpack

然后重新安装它,以便根据您现在使用的 ruby​​ 版本构建库。

你也可以试试:
bundle install --redownload

这应该重新安装 gems 并使用您现在使用的 ruby​​ 版本重建链接库。

关于ruby-on-rails - 由于库版本不兼容,无法创建 Rails 应用程序 - 加载错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59479802/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com