gpt4 book ai didi

rubygems - 无法激活 sinatra-1.4.7,因为 rack-2.0.1 与 rack (~> 1.5) 冲突

转载 作者:行者123 更新时间:2023-12-04 01:37:45 46 4
gpt4 key购买 nike

我刚刚将我的操作系统从 Ubuntu 14.04 LTS 更新到 16.04,并且我正在那里运行我的 Ruby Sinatra 项目。事情是更新后我尝试运行服务器,然后在浏览器中运行 localhost 我收到此错误
启动错误

Something went wrong while loading app.rb
Gem::ConflictError: Unable to activate sinatra-1.4.7, because rack-2.0.1 conflicts with rack (~> 1.5)

/usr/lib/ruby/2.3.0/rubygems/specification.rb:2286:in `raise_if_conflicts'
/usr/lib/ruby/2.3.0/rubygems/specification.rb:1407:in `activate'
/usr/lib/ruby/2.3.0/rubygems.rb:196:in `rescue in try_activate'
/usr/lib/ruby/2.3.0/rubygems.rb:193:in `try_activate'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:125:in `rescue in require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
/home/leandro/Downloads/git-master/ruby sinatra/app.rb:1:in `<top (required)>'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:115:in `inner_app'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:103:in `assemble_app'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:86:in `proceed_as_child'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:31:in `call!'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:18:in `call'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/favicon.rb:12:in `call'
/var/lib/gems/2.3.0/gems/shotgun-0.9.1/lib/shotgun/static.rb:14:in `call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:68:in `block in call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:53:in `each'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:53:in `call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:153:in `call'
/var/lib/gems/2.3.0/gems/rack-2.0.1/lib/rack/handler/webrick.rb:86:in `service'
/usr/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
/usr/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
/usr/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'

我已经在包含 app.rb 的文件夹中尝试了 gem install bundle 和 bundle install。我还在 gem 文件中放置了 gem "rack", "> 1.5"但我仍然有同样的错误。你能帮帮我吗?非常感谢提前

最佳答案

今天我在尝试运行一套自动化测试时遇到了类似的问题(完全相同的错误消息),我正在维护它以某种方式依赖于 Sinatra。

Gem::ConflictError: Unable to activate sinatra-1.4.7, because rack-2.0.1 conflicts with rack (~> 1.5)

我在 this Japanese (?) blog 上找到了解决方案

卸载 rack-2.0.1对我有用
> gem uninstall rack

Select gem to uninstall:
1. rack-2.0.1
2. rack-1.6.4
3. All versions

> 1

Successfully uninstalled rack-2.0.1

关于rubygems - 无法激活 sinatra-1.4.7,因为 rack-2.0.1 与 rack (~> 1.5) 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38712052/

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