How install gems locally?
I have no inter开发者_开发问答net 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
Find all the dependencies of the gem and install them with gem install
or better
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:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
If you are working with Rails, I'd suggest unpacking the gems you need to vendor before deploying to the server.
精彩评论