2017-02-15 96 views
0

因此,這是我第一次使用新的API for rails。我今天想要使用的特殊寶石是這樣的。 https://github.com/gimite/google-drive-ruby/blob/master/README.mdgoogle_drive gem not working「LoadError:can not load such file - google_drive」

人工手動安裝到我的軌道上的一個項目,之後

$ gem install google_drive 

我試圖通過只輸入

require 'google_drive' 

,但返回錯誤來測試它的Ruby控制檯上給我「LoadError:無法加載這樣的文件 - 谷歌駕駛。」

我也嘗試安裝這種寶石,它也沒有幫助

gem install google-api-client 

我想學習如何通過我的網頁形式之一更新我的谷歌牀單......但是這簡單的一步讓我陷入困境。

回答

1

我手動安裝了寶石,通過調用gem install 'google_drive',然後在IRB會話中調用require 'google_drive',工作正常。

您的Rails項目的Gemfile包含寶石(gem 'google_drive')嗎? Rails只會加載該文件中指定的寶石。

+0

哦,所以我必須在我的gem文件中添加gem,即使我手動安裝它。該死的!稍後嘗試 – Napmi

+0

是的,'rails c'只會載入您在Gemfile中專門指定的寶石。 –

+0

謝謝!你是對的 – Napmi