문제

I have no internet connection on server machine, so I need to install gems locally. I tried

gem install rails-2.3.4.gem

But, I'm getting errors.

How Can I install gems locally.

Thanks.

도움이 되었습니까?

해결책

You could either

  1. Find all the dependencies of the gem and install them with gem install

    or better

  2. Copy the gem dirs from another machine (same O.S. etc). You can find the required directory by running the gem environment command and noting the GEM PATHS (see below). You may also have to copy files from the EXECUTABLE DIRECTORY.

    RubyGems Environment:

    • RUBYGEMS VERSION: 1.3.2
    • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
    • INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
    • RUBY EXECUTABLE: /usr/bin/ruby1.8
    • EXECUTABLE DIRECTORY: /usr/bin
    • RUBYGEMS PLATFORMS:
      • ruby
      • x86-linux
    • GEM PATHS:
      • /usr/lib/ruby/gems/1.8
      • /home/chris/.gem/ruby/1.8
    • GEM CONFIGURATION:
    • REMOTE SOURCES:

다른 팁

If you are working with Rails, I'd suggest unpacking the gems you need to vendor before deploying to the server.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top