awesome_print looks like a pretty nice gem, so I wanted to try it out.
I went to one of my projects and did:
gem install awesome_print
and it says one gem installed, documentation installed, etc.
Then, while I am in that project, I went to my Rails console to try it out, but when I did a require "awesome_print" as their help file says, I get a "cannot load such file".
Has anyone got this to work?
gem installwill put the gem code on your computer, but unless the gem's source code files are on your load path,requirewon't be able to find them.bundle execlooks at the nearestGemfile.lockand adds the source code for all the gems listed there to your load path. Rails initialization includes getting Bundler to do this for you.One solution is to add
awesome_printto yourGemfile. However, this will cause your application to haveawesome_printas a dependency. Alternatively you can manually add theawesome_printlibrary to your load path after starting up the Rails console and then requiring it:If you're using RVM, the path is likely to be something like: