尝试运行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中也是如此,但这并不起作用。
有什么想法吗?
发布于 2015-04-14 10:10:35
我也有同样的问题。我删除了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发布于 2015-04-06 02:09:21
在我的Gemfile中指定:
gem 'sinatra-contrib', github: 'sinatra/sinatra-contrib'和运行
bundle update帮我修好了。
https://stackoverflow.com/questions/29421099
复制相似问题