Sinatra Error: Cannot activate sinatra-contrib-1.4.2

Trying to run the Sinatra application, and I keep getting this error:

/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>'

This is my gemfile:

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

I tried to turn on

gem 'tilt', '~> 1.3' 

in the gemfile, but that didn't work.
Any ideas?

+4
source share
2 answers

I had the same problem. I uninstalled Tilt 2.0.1 and my application is working as expected.

Remove gemstone:

$ 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.

Reloaded application (via Pow):

~/app-dir$ touch tmp/restart.txt
+4
source

Indication of this in my gemfile:

gem 'sinatra-contrib', github: 'sinatra/sinatra-contrib'

and working

bundle update

fixed it for me.

+2
source

All Articles