rubygems / bundler-site

The Bundler documentation website
https://bundler.io
110 stars 206 forks source link

bundler-site documentation :path behavior confusion #546

Open danlo opened 3 years ago

danlo commented 3 years ago

Greetings,

I was reviewing the documentation for loading a gem via: "gem .... path: dir" in an attempt to install a gem directly from the file system.

Site Documentation

As I read the documentation for v2.2 (latest) at https://bundler.io/v2.2/man/gemfile.5.html#PATH it says:

Similar to the semantics of the :git option, the :path option requires that the directory in question either contains a .gemspec for the gem, or that you specify an explicit version that bundler should use.

The feature that you specify an explicit version did not work for me.

As I reviewed the code & documentation. I downloaded rubygems/bundler-site and attempted to grep the above documentation.

I found the following documentation instead which appears more correct:

Source code for Site documentation

At: https://github.com/rubygems/bundler-site/blob/master/source/v2.2/gemfile.html.haml#L125

    .bullet
      .description
        If you would like to use an unpacked gem directly from the filesystem, simply set the <code>:path</code> option to the path containing the gem's files.
      :code
        # lang: ruby
        gem 'extracted_library', :path => './vendor/extracted_library'

The above documentation appears to be correct, in my experiments with the code.

Summary

I believe the website documentation is out of date with the documentation source code and am asking you to review this confusion.

What I was trying to do....

I was attempting to install a gem locally via:

Gemfile

gem 'lex', '0.0.14', path: 'gems'

What I expected to happen, was that "lex-0.0.14.gem" would be unpacked and installed into

/home/[user]/.bundle/ruby/2.7.0/gems/lex-0.0.14

The bundle(r) does not work in this manner as I thought it would.

If I can help in any manner, please give me a pointer to how to resolve this conflict and I will be happy to fork and update any documentation.

Thank you!

Daniel Lo

deivid-rodriguez commented 3 years ago

This documentation is indeed confusing but for two things: