gpt4 book ai didi

ruby-on-rails - Ruby on Rails 不兼容库

转载 作者:数据小太阳 更新时间:2023-10-29 06:48:53 27 4
gpt4 key购买 nike

我刚刚开始了解 ruby​​ on rails,但无法让服务器运行。我正在运行 ruby​​ 2.3.0 和 rails 4.2.5,在我有一个新的 rail 项目后,我尝试运行 bin/rails server 但出现以下错误:

Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
/Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json/ext.rb:13:in `require': incompatible library version - /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json/ext/parser.bundle (fatal)
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json/ext.rb:13:in `<module:Ext>'
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json/ext.rb:12:in `<module:JSON>'
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json/ext.rb:9:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json.rb:58:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json.rb:58:in `<module:JSON>'
from /Users/John/.rvm/gems/ruby-head/gems/json-1.8.3/lib/json.rb:54:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/activesupport-4.2.5/lib/active_support/core_ext/object/json.rb:2:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/activesupport-4.2.5/lib/active_support/core_ext/object/json.rb:2:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/activesupport-4.2.5/lib/active_support/core_ext/object.rb:12:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/activesupport-4.2.5/lib/active_support/core_ext/object.rb:12:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/configuration.rb:2:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/configuration.rb:2:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/railtie.rb:2:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/railtie.rb:2:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/engine.rb:1:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/engine.rb:1:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/application.rb:7:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/application.rb:7:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails.rb:11:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails.rb:11:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/server.rb:4:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/server.rb:4:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:73:in `server'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/John/.rvm/gems/ruby-head/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/John/Developer/Rails/blog/bin/rails:9:in `require'
from /Users/John/Developer/Rails/blog/bin/rails:9:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `load'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `call'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/client/command.rb:7:in `call'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/client.rb:28:in `run'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/bin/spring:51:in `<top (required)>'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `load'
from /Users/John/.rvm/gems/ruby-head/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/John/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/John/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/John/Developer/Rails/blog/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

Gem list 说我有 json (1.8.3, 1.8.2)。我还尝试重新安装 rails 并通过 rvm 更新我的 ruby​​ 版本。知道有什么问题吗?我试过在网上四处看看,但有点卡住了,尤其是因为我以前从未使用过 Rails,而且只用过一点 ruby 。

最佳答案

在您的 ruby​​ 环境中有些东西变得奇怪/损坏。我会责怪rvm。我个人不是 rvm 的粉丝。

但您可以尝试gem uninstall json,按照提示卸载所有版本。然后再次 bundle install。然后希望你会被修复。

关于ruby-on-rails - Ruby on Rails 不兼容库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34474847/

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