How to put a . Gem in Gemfile

Asked

Viewed 184 times

0

Good afternoon, I’m having a problem installing a . Gem through Gemfile. In Gemfile is:

gem 'hanaclient', path: '/usr/sap/hdbclient/ruby/hanaclient'

Within the /usr/sap/hdbclient/ruby/hanaclient (ls):

hanaclient-2.3.119-x86_64-linux.gem

When executing the Bundle install, returns:

Could not find gem 'hanaclient' in source at `/usr/sap/hdbclient/ruby/hanaclient`.
The source does not contain any versions of 'hanaclient'

Any solution? Thank you.

  • Gem version added in Gemfile gem 'hanaclient', '2.3.119', path: '/usr/sap/hdbclient/ruby/hanaclient', and the problem was solved, but I got another problem that apparently, even installed, the Gem could not be loaded when I try to give a require 'hanaclient': LoadError: cannot load such file -- hanaclient

1 answer

0


The problem is occurring because it is pointing to a file .gem, and it must be unpacked. Therefore:

gem unpack my_gem.gem --target app_path/vendor/gems

After unpacking, just refer to the Gemfile:

gem 'my_gem', :path => 'vendor/gems/my_gem'

Just one note: Are you trying to list a local Gem on Gemfile. Usually this creates problems between different environments and is not recommended.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.