0

I am making a Rails(3.0.4) application using the youtube_it API.

I installed the gem using gem install youtube_it, but when I run the script I get this error:

can't activate faraday (>= 0.7.3, runtime) for ["youtube_it-2.1.1"], already activated faraday-0.5.7 for ["instagram-0.8"]

How should I resolve this without removing the existing version of faraday?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
serpent403
  • 803
  • 16
  • 32
  • Bundle exec cant be done in my app so I am trying another way to do this, i have put the youtube_it folder in /vendor/plugins/ dir of my application. But i am getting an error "NoMethodError: undefined method `dependency' for Faraday::Request::OAuth:Class" when i do require 'youtube_it'. What is wrong? – serpent403 Jan 21 '12 at 11:14

2 Answers2

0

I don't think you can. You should update faraday to its latest version. Is there a valid reason not to?

Alexei Danchenkov
  • 2,011
  • 5
  • 34
  • 49
0

First, you should be adding youtube_it to your Gemfile, then running bundle install.

This gives bundler enough information to figure out the dependency graph of all the gems your application needs. Bundler writes out the needed gems, their dependencies and versions to the Gemfile.lock file.

Second, when running the rails command, you shouldn't need to run bundle exec according to Yehuda Katz (http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/). However, in my experience there have been times when bundle exec has been necessary even for the rails command.

In any case, running "bundle exec executable" will run your executable (rails, rake, etc) with the gems listed in the Gemfile.lock, avoiding the dreaded "can't activate -- already activated" error.

edk750
  • 1,115
  • 10
  • 11