Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4748

Gem works in IRB but not Rails console

$
0
0

I am trying to use the Hubspot API Ruby gem located here https://github.com/HubSpot/hubspot-api-ruby#installation, but I am having issues with Ruby on Rails.

For all of my other gems, I can just simply add the gem in the Gemfile and it works within the application, but not this case and I cannot figure out why.

For example, here's what I have in my Gemfile:

# HubSpot API Clientgem 'hubspot-api-client'

I have ran bundle install and it installed successfully, but I still can't use that gem. If I load the gem via the irb console, then it works just fine.

Here's what I mean:

Using IRB

root@8af3866a29c8:/myapp# irbirb(main):001:0> require 'hubspot-api-client'=> trueirb(main):002:0> Hubspot=> Hubspot

Using Rails Console

root@8af3866a29c8:/myapp# rails cRunning via Spring preloader in process 6589Loading development environment (Rails 5.2.4)irb(main):001:0> require 'hubspot-api-client'Traceback (most recent call last):        1: from (irb):1LoadError (cannot load such file -- hubspot-api-client)irb(main):001:0> HubspotTraceback (most recent call last):        1: from (irb):1NameError (uninitialized constant Hubspot)irb(main):002:0> 

Why does this happen and how do I fix this?


Viewing all articles
Browse latest Browse all 4748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>