legendary_rob
legendary_rob

Reputation: 13012

Rails Gem not loading in rails app

I have written my own Gem called date_ninja which makes sure a date is returned in the correct when passing a date from excel. Testing the gem it works fine. For example opening irb, and calling require 'date_ninja' returns true and I am able to use.

DateNinja::DateDojo.date_format_validation(value).

This will either return an date or an exception.

In my Rails App, I have added the gem to my gemfile as so:

gem 'date_ninja', git: '[email protected]:mpowered/date_dojo'

I then ran bundle install but when I use it, I get this:

DateNinja::DateDojo.date_format_validation(56423)
  NameError: uninitialized constant DateNinja::DateDojo
  from (pry):5:in `<main>'

If I open the Rails console and see if I can require 'date_ninja' it => false so I am guessing its not loading my gem even though I have bundled it. Am I missing a step?

Upvotes: 1

Views: 757

Answers (1)

Lazarus Lazaridis
Lazarus Lazaridis

Reputation: 6029

Can you try replacing the line:

gem 'date_ninja', git: '[email protected]:mpowered/date_dojo'

with

gem 'date_ninja', path: 'local/path/of/ninja'

If this works then something is not well set with git.

Upvotes: 1

Related Questions