2014-05-10 2 views
0

YouTube에서 동영상을 검색 할 수있는 앱을 만들고 싶습니다. 가장 인기있는 선택은 youtube_it gem입니다.내 컨트롤러에서 youtube_it을 초기화 할 수 없습니다.

내 Gemfile에 gem을 추가하고 bundle install을 실행하십시오. bundle query --local 할 때 보석이 미리 설정되어 있음을 알 수 있습니다 (버전 2.1.4).

그래서, README에 따라 내가 내 컨트롤러에 이런 식으로 뭔가를해야 할 날 것으로 보인다 (?) :

class ConsoleController < ApplicationController 
    . 
    . 
    . 

    def search 
    require 'youtube_it' 
    client = YouTubeIt::Client.new(:dev_key => "my developer key") 
    end 
end 

하지만 난 얻을 "등의 파일을로드 할 수 없습니다 - youtube_it"오류

require 함수를 제거하면 "초기화되지 않은 상수 ConsoleController :: YouTubeIt"오류가 발생합니다.

내가 잘못하고있는 것을 아는 사람이 있습니까?

UPDATE :

/Gemfile.lock

GEM 
    remote: https://rubygems.org/ 
    specs: 
    actionmailer (4.0.3) 
     actionpack (= 4.0.3) 
     mail (~> 2.5.4) 
    actionpack (4.0.3) 
     activesupport (= 4.0.3) 
     builder (~> 3.1.0) 
     erubis (~> 2.7.0) 
     rack (~> 1.5.2) 
     rack-test (~> 0.6.2) 
    activemodel (4.0.3) 
     activesupport (= 4.0.3) 
     builder (~> 3.1.0) 
    activerecord (4.0.3) 
     activemodel (= 4.0.3) 
     activerecord-deprecated_finders (~> 1.0.2) 
     activesupport (= 4.0.3) 
     arel (~> 4.0.0) 
    activerecord-deprecated_finders (1.0.3) 
    activesupport (4.0.3) 
     i18n (~> 0.6, >= 0.6.4) 
     minitest (~> 4.2) 
     multi_json (~> 1.3) 
     thread_safe (~> 0.1) 
     tzinfo (~> 0.3.37) 
    addressable (2.3.6) 
    arel (4.0.2) 
    bcrypt (3.1.7) 
    bootstrap-sass (3.1.1.1) 
     sass (~> 3.2) 
    builder (3.1.4) 
    capybara (2.2.1) 
     mime-types (>= 1.16) 
     nokogiri (>= 1.3.3) 
     rack (>= 1.0.0) 
     rack-test (>= 0.5.4) 
     xpath (~> 2.0) 
    coderay (1.1.0) 
    coffee-rails (4.0.1) 
     coffee-script (>= 2.2.0) 
     railties (>= 4.0.0, < 5.0) 
    coffee-script (2.2.0) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.7.0) 
    devise (3.2.4) 
     bcrypt (~> 3.0) 
     orm_adapter (~> 0.1) 
     railties (>= 3.2.6, < 5) 
     thread_safe (~> 0.1) 
     warden (~> 1.2.3) 
    diff-lcs (1.2.5) 
    erubis (2.7.0) 
    execjs (2.0.2) 
    factory_girl (4.2.0) 
     activesupport (>= 3.0.0) 
    factory_girl_rails (4.2.1) 
     factory_girl (~> 4.2.0) 
     railties (>= 3.0.0) 
    haml (4.0.5) 
     tilt 
    haml-rails (0.5.3) 
     actionpack (>= 4.0.1) 
     activesupport (>= 4.0.1) 
     haml (>= 3.1, < 5.0) 
     railties (>= 4.0.1) 
    hike (1.2.3) 
    i18n (0.6.9) 
    jbuilder (1.5.3) 
     activesupport (>= 3.0.0) 
     multi_json (>= 1.2.0) 
    jquery-rails (3.1.0) 
     railties (>= 3.0, < 5.0) 
     thor (>= 0.14, < 2.0) 
    json (1.8.1) 
    launchy (2.4.2) 
     addressable (~> 2.3) 
    mail (2.5.4) 
     mime-types (~> 1.16) 
     treetop (~> 1.4.8) 
    method_source (0.8.2) 
    mime-types (1.25.1) 
    mini_portile (0.5.3) 
    minitest (4.7.5) 
    multi_json (1.9.3) 
    nokogiri (1.6.1) 
     mini_portile (~> 0.5.0) 
    orm_adapter (0.5.0) 
    pg (0.17.1) 
    polyglot (0.3.4) 
    pry (0.9.12.6) 
     coderay (~> 1.0) 
     method_source (~> 0.8) 
     slop (~> 3.4) 
    pry-rails (0.3.2) 
     pry (>= 0.9.10) 
    rack (1.5.2) 
    rack-test (0.6.2) 
     rack (>= 1.0) 
    rails (4.0.3) 
     actionmailer (= 4.0.3) 
     actionpack (= 4.0.3) 
     activerecord (= 4.0.3) 
     activesupport (= 4.0.3) 
     bundler (>= 1.3.0, < 2.0) 
     railties (= 4.0.3) 
     sprockets-rails (~> 2.0.0) 
    railties (4.0.3) 
     actionpack (= 4.0.3) 
     activesupport (= 4.0.3) 
     rake (>= 0.8.7) 
     thor (>= 0.18.1, < 2.0) 
    rake (10.3.1) 
    rdoc (4.1.1) 
     json (~> 1.4) 
    rspec-core (2.14.8) 
    rspec-expectations (2.14.5) 
     diff-lcs (>= 1.1.3, < 2.0) 
    rspec-mocks (2.14.6) 
    rspec-rails (2.14.2) 
     actionpack (>= 3.0) 
     activemodel (>= 3.0) 
     activesupport (>= 3.0) 
     railties (>= 3.0) 
     rspec-core (~> 2.14.0) 
     rspec-expectations (~> 2.14.0) 
     rspec-mocks (~> 2.14.0) 
    sass (3.2.19) 
    sass-rails (4.0.3) 
     railties (>= 4.0.0, < 5.0) 
     sass (~> 3.2.0) 
     sprockets (~> 2.8, <= 2.11.0) 
     sprockets-rails (~> 2.0) 
    sdoc (0.4.0) 
     json (~> 1.8) 
     rdoc (~> 4.0, < 5.0) 
    slop (3.5.0) 
    sprockets (2.11.0) 
     hike (~> 1.2) 
     multi_json (~> 1.0) 
     rack (~> 1.0) 
     tilt (~> 1.1, != 1.3.0) 
    sprockets-rails (2.0.1) 
     actionpack (>= 3.0) 
     activesupport (>= 3.0) 
     sprockets (~> 2.8) 
    thor (0.19.1) 
    thread_safe (0.3.3) 
    tilt (1.4.1) 
    treetop (1.4.15) 
     polyglot 
     polyglot (>= 0.3.1) 
    turbolinks (2.2.2) 
     coffee-rails 
    tzinfo (0.3.39) 
    uglifier (2.5.0) 
     execjs (>= 0.3.0) 
     json (>= 1.8.0) 
    warden (1.2.3) 
     rack (>= 1.0) 
    xpath (2.0.0) 
     nokogiri (~> 1.3) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    bootstrap-sass (~> 3.1.1) 
    capybara 
    coffee-rails (~> 4.0.0) 
    devise 
    factory_girl_rails (~> 4.2.1) 
    haml-rails 
    jbuilder (~> 1.2) 
    jquery-rails 
    launchy (~> 2.4.2) 
    pg 
    pry-rails 
    rails (= 4.0.3) 
    rspec-rails 
    sass-rails (~> 4.0.0) 
    sdoc 
    turbolinks 
    uglifier (>= 1.3.0) 
+0

bundle install 당신에게 Gemfile.lock하십시오 – LukasMac

+0

안녕을 보여 실행될 때 다시 확인합니다. 내 게시물을 Gemfile.lock로 업데이트했습니다. 감사합니다 – Martyn

답변

1

youtube_it 보석이 아직 설치되지 않은 것으로 보인다. gem 'youtube_it'Gemfile에 포함 된 실행 bundle update

을 또는 당신은 또한 Gemfile.lock을 삭제하고

+0

안녕하세요. 그것이 그 보석입니다. 나는 이전에 그랬던 것처럼 우발적으로 그것을 꺼내 들었을 것입니다 (이전에 그것을 포함 시키면 버전 번호를 얻을 수있었습니다). 죄송합니다. 근본적인 오류입니다. 그것은 당신의 도움입니다. – Martyn

관련 문제