So, reading http://git-scm.com/book/en/v1/Git-on-the-Server-Public-Access, I’m trying to setup a bare repo as instructed on a simple http server (no git-daemon, do I need one?).
My gem has a gemname.gemspec in the root and all seems well.
On using a Gemfile with:
gem 'gemname', :git => 'http://path'
Ok, then
> bundle install
...
Installing blah...
Using gemname (1.0.0) from source at 'http://path'
...
and all seems well, until I list the gems and ‘gemname’ isn’t there. Require also fails.
So then, plan #2: since we mirror the server as paths, I figure I’ll use a direct path to the gem without the git repo:
gem 'gemname', :path => 'path/to_gemname'
again, bundler says ok.
Using gemname (1.0.0) from source at 'path/to_gemname'
but again, doesn’t install it or reference it correctly from within the app.
Any idea on how this should work (i.e. proper directory layout, etc.) or do I need a real git/gem server to do this?
Thanks!
You need to use
Bundler.setupfirst.You might also find it useful to call
Bundler.require. This will require all gems in the Gemfile automagically. No need to callrequire "gem name"for every gem you use.Also have a look at this similar answer, which provides a more sophisticated version of the above code: Bundler isn't loading gems
You can check if everything worked by typing
bundle listin a command line window. You should see something like the following.