PackedUp
PackedUp

Reputation: 391

Bundler install custom path issue

gem env shows

GEM PATHS:

  /usr/local/share/gems

I would like to use bundle install --deployment --path=/usr/local/share/gems to install my bundled gems.

The problem is that the bundle install creates a folder ruby and puts the gems folder inside the ruby folder.

When this happens my ruby code is unable to find the gems in its default path.

Looks like I am missing some configuration parameter. Help please.

Upvotes: 1

Views: 783

Answers (2)

Tim Moore
Tim Moore

Reputation: 9492

Alternatively, if you want to force installation to the system gem location, I believe bundle install --deployment --system will do what you want.

Upvotes: 0

PackedUp
PackedUp

Reputation: 391

Maurício Linhares comments in the question has resolved the issue.

When using bundler to install gems use bundle exec ruby. When the bundle install --deployment happens the path information goes into .bundle/config

bundle exec ruby path-to-ruby-script.rb

The above execution Will find the gems installed by the bundle command.

Upvotes: 1

Related Questions