Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Set up Git and Add Gems

Error in Gemfile

when trying to install bundle i get this in the terminal

/Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:89:in parse': Illformed requirement ["~2.1.0"] (Gem::Requirement::BadRequirementError) /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:119:inblock in initialize' /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:119:in map!' /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:119:ininitialize' /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:56:in new' /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/requirement.rb:56:increate' /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:58:in initialize' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dependency.rb:43:ininitialize' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:74:in new' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:74:ingem' /Users/user/Desktop/Everything/Ruby/Treehouse Lessons/odot/Gemfile:24:in block in eval_gemfile' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:157:ingroup' /Users/user/Desktop/Everything/Ruby/Treehouse Lessons/odot/Gemfile:23:in eval_gemfile' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:32:ininstance_eval' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:32:in eval_gemfile' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/dsl.rb:10:inevaluate' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/definition.rb:25:in build' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler.rb:155:indefinition' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/cli/install.rb:77:in run' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/cli.rb:145:ininstall' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/vendor/thor/command.rb:27:in run' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/vendor/thor/invocation.rb:121:ininvoke_command' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/vendor/thor.rb:363:in dispatch' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/vendor/thor/base.rb:440:instart' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/cli.rb:9:in start' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/bin/bundle:20:inblock in <top (required)>' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/lib/bundler/friendly_errors.rb:5:in with_friendly_errors' /Users/user/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.12/bin/bundle:18:in<top (required)>' /Users/user/.rbenv/versions/2.2.0/bin/bundle:23:in load' /Users/user/.rbenv/versions/2.2.0/bin/bundle:23:in<main>' There was an error in your Gemfile, and Bundler cannot continue.

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,433 Points

It would be helpful to see how your gemfile looks like. My best guess is you wrote "~2.1.0" somewhere in the Gemfile and it should be "~> 2.1.0" instead.

You were totally right.

Yay! Thanks so much. I had the same problem and wanted to bang my head against the wall. You saved me a big bruise. Cheers!