Hi there,

just to introduce my problem: because I have a bad internet connection I
want to
create a local repository on one of my PCs here in the office, and
install gems
from this PC (instead of rubygems).

I looked to a lot of blogs, manuals, etc., but I can not get it working.

This is what I did:

On my PC (which should be my local gem repository) - Linux system


1. mkdir /var/www/localhost/htdocs/gems
2. cp /usr/local/lib64/ruby/gems/1.9.1/cache/*.gem
/var/www/localhost/htdocs/gems
3. gem generate_index -d /var/www/localhost/htdocs

This creates the following in /var/www/localhost/htdocs:

Marshal.4.8
Marshal.4.8.Z
latest_specs.4.8
latest_specs.4.8.gz
prerelease_specs.4.8
prerelease_specs.4.8.gz
quick
specs.4.8
specs.4.8.gz

4. Starting the server with

    gem server --dir /var/www/localhost/htdocs/


This ends up with the following error message:

ERROR: While executing gem ... (ArgumentError)
/var/www/localhost/htdocs does not appear to be a gem repository


When I start gem server (which is linked to
/usr/local/lib64/ruby/gems/1.9.1 by
default) the gem server starts perfect.


Comparing these directories the /usr/local/lib64/ruby/gems/1.9.1
directory
contains bin, cache, doc, gems, specifications

Not so for my "new" directory: /var/www/localhost/htdocs. Also the
gemspec files
are hold different (in /var/www/localhost/htdocs under quick/Marshal.4.8
they are inflated with gemspec.rz)


So the question is: how can I create a repository like under
/usr/local/lib64/ruby/gems/1.9.1 . Is there a special command?


Thanks for any advice,

Holm

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Luis Lavena at Jan 4, 2012 at 4:06 pm

    On Jan 4, 12:06 pm, Holm Dressler wrote:
    Hi there,


    On my PC (which should be my local gem repository) - Linux system

    1. mkdir /var/www/localhost/htdocs/gems
    2. cp /usr/local/lib64/ruby/gems/1.9.1/cache/*.gem
    /var/www/localhost/htdocs/gems
    3. gem generate_index -d /var/www/localhost/htdocs
    If you use generate_index, you can serve the files directly with
    Apache.
    4. Starting the server with

    gem server --dir /var/www/localhost/htdocs/

    This ends up with the following error message:

    ERROR:  While executing gem ... (ArgumentError)
    /var/www/localhost/htdocs does not appear to be a gem repository
    `gem server` is expecting a folder structure like this:

    ls -l /path

    bin
    cache
    doc
    gems
    specification
    So the question is: how can I create a repository like under
    /usr/local/lib64/ruby/gems/1.9.1 . Is there a special command?
    gem install foo -i /path

    Then

    gem server --dir /path

    PS: If you want to host gems locally, please take a look to stickler
    [1] or gemfury for hosted/remote one [2]

    [1] https://github.com/copiousfreetime/stickler
    [2] http://www.gemfury.com/
    --
    Luis Lavena

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Holm Dressler at Jan 5, 2012 at 11:56 am
    Hi Luis,

    cool thanks. It works now. Honestly: I spend about 4 hours and read all
    stuff with generate_index. But at least you gave me the solution.

    Thanks,

    Holm

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Ron mm at Aug 14, 2013 at 1:03 pm
    It is worth mentioning that Artifactory Pro, starting at version 3.0.3,
    fully supports RubyGems local, remote and virtual repositories.
    Remote repositories can eliminate the vulnerabilities caused by bad/slow
    networking to rubygems.org.
    Local repositories can be used for hosting in-house gems in a secured
    and reliable manner.
    This solution is not free, but might be the best solution for an
    enterprise environment.

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4a6210848d356b594bf2b6b36fffbc9e%40ruby-forum.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 4, '12 at 3:07p
activeAug 14, '13 at 1:03p
posts4
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Ron mm: 3 posts Luis Lavena: 1 post

People

Translate

site design / logo © 2021 Grokbase