简体   繁体   English

Ruby on Rails要求放置require和enable?

[英]Ruby on Rails asking to put require and enable?

I'm not sure where to put require and enable? 我不确定在哪里放置需求和启用?

I'm trying to use the instagram api, but it's telling me to put 我正在尝试使用instagram api,但告诉我放

require "sinatra"
require "instagram"

enable :sessions

in the sample application : https://github.com/Instagram/instagram-ruby-gem 在示例应用程序中: https : //github.com/Instagram/instagram-ruby-gem

But I'm new to learning rails, so I'm just trying figure some bits out, 但是我是初学者,所以我只是想弄清楚一点,

Thanks 谢谢

Thats for a sintatra app, not a rails app, for rails all I think you need to do is add it to your gemfile like so. 那对于sintatra应用程序,而不是rails应用程序,对于rails,我认为您需要做的就是像这样将其添加到您的gemfile中。

gem 'instagram'

If you still can't use it try adding :require, though I don't think you should have to. 如果您仍然无法使用它,请尝试添加:require,尽管我认为您不必这样做。

gem 'instagram', :require => 'instagram'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM