gemspec dependency vs local ruby code

Hello everyone, hope you all are well.

I'm having trouble with getting access to some libraries installed via gem.
It's a bit complicated so let me see if I can explain it half decent.

1) I am working on a rubygem for a testing engine, similar to RSpec or
Cucumber. This test engine gem, matches bullet points to ruby code.

2) I am using this rubygem, in a separate codebase.

3) In this second codebase, I am installing HTTParty to make http calls.
However, when I gem install httparty to my local gemset (I'm using RVM), I
am *unable* to find httparty. I tried bundle exec as well and didn't work.

The only solution right now seems to be, to add httparty as a runtime
dependency to my test engine gem. However, I want that engine gem to be
lightweight because it can be used to test whatever.

The question then, how can I install additional gems beyond #1 to be used
in #2, directly in #2 without having to modify this lightweight testing
engine ?

Hopefully that was at least mostly understandable ?

Thanks ~~~

···

--
A musician must make music, an artist must paint, a poet must write, if he
is to be ultimately at peace with himself.
- Abraham Maslow

Hi Sean,

I think I am doing something similar but with different results - it works for me. To be able to help a bit more, may I ask a few questions?

Hello everyone, hope you all are well.

I'm having trouble with getting access to some libraries installed via gem. It's a bit complicated so let me see if I can explain it half decent.

1) I am working on a rubygem for a testing engine, similar to RSpec or Cucumber. This test engine gem, matches bullet points to ruby code.

2) I am using this rubygem, in a separate codebase.

3) In this second codebase, I am installing HTTParty to make http calls. However, when I gem install httparty to my local gemset (I'm using RVM), I am *unable* to find httparty. I tried bundle exec as well and didn't work.

The only solution right now seems to be, to add httparty as a runtime dependency to my test engine gem. However, I want that engine gem to be lightweight because it can be used to test whatever.

The question then, how can I install additional gems beyond #1 to be used in #2, directly in #2 without having to modify this lightweight testing engine ?

1. Have you published the gem in #1 and how is it defined/ used from the second codebase?

2. Could you share the Gemfile that you have for the second codebase?

3. Is the second codebase another Gem or an application that uses your Gem#1 and other gems?

4. Just to be doubly sure, make sure that you:
a) Have a Gemfile for the second codebase
b) Have run bundle install for that gemfile
c) In the code that uses HTTParty, do a require 'httparty' to make sure that it is available. You might also need to do: require 'bundler/setup'

5. Finally, and this is probably some good news - bundler doesn't do magic :slight_smile:
Read this: https://bundler.io/v2.1/guides/bundler_setup.html to ensure that the correct groups are loaded, etc.

Hope something helps.

Best Regards,
Mohit.

···

On 2020-9-23 1:06 am, Sean Felipe Wolfe wrote:

Hi All

I have you use teradata database. What gem should I use?

Thanks
Anitha

···

On Tue, 22 Sep, 2020, 10:37 pm Sean Felipe Wolfe, <ether.joe@gmail.com> wrote:

Hello everyone, hope you all are well.

I'm having trouble with getting access to some libraries installed via
gem. It's a bit complicated so let me see if I can explain it half decent.

1) I am working on a rubygem for a testing engine, similar to RSpec or
Cucumber. This test engine gem, matches bullet points to ruby code.

2) I am using this rubygem, in a separate codebase.

3) In this second codebase, I am installing HTTParty to make http calls.
However, when I gem install httparty to my local gemset (I'm using RVM), I
am *unable* to find httparty. I tried bundle exec as well and didn't work.

The only solution right now seems to be, to add httparty as a runtime
dependency to my test engine gem. However, I want that engine gem to be
lightweight because it can be used to test whatever.

The question then, how can I install additional gems beyond #1 to be used
in #2, directly in #2 without having to modify this lightweight testing
engine ?

Hopefully that was at least mostly understandable ?

Thanks ~~~

--
A musician must make music, an artist must paint, a poet must write, if he
is to be ultimately at peace with himself.
- Abraham Maslow

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>