Search code examples
ruby-on-railsrubygitgithubjrubyonrails

uninitialized constant CommitsController::GitHub


I am running JRuby rails. I am trying to access all the commit information (such as commit comments, committer, time of commit), given a github repositiry url for a file using mbleigh-ruby-github ruby gem. When initializing to the github namesapce, I am getting the following error: "uninitialized constant CommitsController::GitHub"

In my controller, I have the following line

 user = GitHub::API.user('mbleigh')

In gem file I have the following line

source 'http://gems.github.com'
gem 'mbleigh-ruby-github'

Any help would be appreciated, thanks.


Solution

  • uninitialized constant CommitsController::GitHub

    According to the README you should have require 'ruby-github' in your commits_controller which should solve the error.

    #commits_controller.rb
    require 'ruby-github'
    user = GitHub::API.user('mbleigh')