gpt4 book ai didi

ruby - 辛纳特拉错误 : Unable to activate sinatra-contrib-1. 4.2

转载 作者:数据小太阳 更新时间:2023-10-29 07:28:32 25 4
gpt4 key购买 nike

尝试运行 Sinatra 应用程序时,我不断收到此错误:

/Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2064:in `raise_if_conflicts': 
Unable to activate sinatra-contrib-1.4.2, because tilt-2.0.1 conflicts with tilt (~> 1.3) (Gem::LoadError)
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems.rb:196:in `rescue in try_activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems.rb:193:in `try_activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from app.rb:3:in `<main>'

这是我的 Gemfile:

gem 'sinatra', '~> 1.4.5'
gem 'activerecord'
gem 'pg'

我试过包括

gem 'tilt', '~> 1.3' 

也在 Gemfile 中,但那没有用。
有什么想法吗?

最佳答案

我遇到了同样的问题。我删除了 Tilt 2.0.1,我的应用程序按预期工作。

删除 gem :

$ gem uninstall tilt -v 2.0.1
Successfully uninstalled tilt-2.0.1

$ bundle install
Resolving dependencies...
...
Bundle complete! 9 Gemfile dependencies, 17 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

重新启动应用程序(通过 Pow):

~/app-dir$ touch tmp/restart.txt

关于ruby - 辛纳特拉错误 : Unable to activate sinatra-contrib-1. 4.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29421099/

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