Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails -- uninitialized constant 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 across the same error with both fb_graph and koala. I added the gem to my gemfile and then bundle installed it. I thought that was all you had to do, so I then tried using commands demonstrated in their respective wikis on github to see if they would work for me.

In the case of Koala, I added the line @graph = Koala::Facebook::GraphAPI.new to my Pages controller which displays pages#home. I got the error uninitialized constant PagesController::Koala.

In the case of FB_Graph, I added the line user = FbGraph::User.me(ACCESS_TOKEN) and got the error uninitialized constant PagesController::FBGraph.

Clearly I'm not doing something right - maybe there's something about configuring gems I installed that I'm missing - not really sure. I've never really messed around with the FB API before, so it's possible the error is specifically related to FB gems. Please advise.

like image 336
Kvass Avatar asked Feb 20 '23 23:02

Kvass


1 Answers

Try

gem install koala

gem install fb_graph

first

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

like image 163
Michael Durrant Avatar answered Mar 03 '23 00:03

Michael Durrant