Rails - uninitialized permanent error for newly installed gems

I'm having trouble using newly installed gems - I think there must be something I'm missing because I ran into the same error with both fb_graph and koala. I added a gem to my gemfile and then bundle install

ed. I thought this was all you needed to do, so I tried using the commands demonstrated in their respective wiki on github to see if they worked for me.

In Koala's case, I added a line @graph = Koala::Facebook::GraphAPI.new

to my page controller that renders pages#home

. I got an error uninitialized constant PagesController::Koala

.

In the case of FB_Graph, I added a line user = FbGraph::User.me(ACCESS_TOKEN)

and got an error uninitialized constant PagesController::FBGraph

.

Clearly I am not doing something right - maybe there is something about setting the gems I have installed that I am missing - not really sure. I have never encountered the FB API before, so it is possible that the error is related to the FB gems. Please advise.

+3


source to share


2 answers


Try

gem install koala

gem install fb_graph

      



the first

and restart the rails server and it should now have it.

+6


source


You will probably need a stone. Add them to the top of your controller.

require "koala"



require "fbgraph"

+3


source







All Articles