下载所有宝石依赖项 [英] Download all gems dependencies

查看:92
本文介绍了下载所有宝石依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过下载任何所需的文件并将它们带到另一台没有互联网连接的机器来安装指南针。我已经下载了指南针的源码包,当我在未连接的机器上运行gem时,它抱怨缺少依赖关系。任何解决方案?

解决方案

这正是我遇到的问题。

搜索了一段时间后,使用Bundler工作的解决方案 http://gembundler.com/



<使用依赖关系获取Gem:


  • 创建一个名为Gemfile的文件夹。

  • 编写一个源文件和您想要将依赖文件保存到的文件

  • Bsp:


    源文件 http://rubygems.org

    gem'rails','3.2.1'


  • 在此文件夹中打开命令行执行:捆绑安装
  • >这应该下载并安装所有Dependencys
  • 执行命令捆绑列表如果您想查看它

  • 执行命令捆绑软件包

  • Thi应该创建目录结构供应商/缓存

  • 缓存内部目录现在是您需要的所有Dependencys您的宝石



在没有互联网连接的机器上安装Gem:


  • 将缓存文件夹复制到本机

  • 在缓存文件夹中打开命令行并执行 gem install --local Gemname.gem
  • Bsp:


    gem install --local rails-3.2.1.gem



I want to install compass by downloading any required file and taking them to another machine without internet connection. I have downloaded the source package for compass and when I run gem on it in the non connected machine it complains about missing dependencies. Any solution?

解决方案

Thats exactly the problem I had.
After searching around a while I found a Solution who works using Bundler http://gembundler.com/

Getting Gem with Dependencies:

  • Create a new Folder with a File named Gemfile in it.
  • Write a Source and the Gem you want to have the dependencys for into the File
  • Bsp:

    source "http://rubygems.org"
    gem 'rails', '3.2.1'

  • Open a Commandline at this Folder an Execute: bundle install
  • This should download and install all Dependencys
  • Execute the Command bundle list if you wanna see it
  • Execute the Command bundle package
  • This should create the Directory Structure vendor/cache
  • Inside the cache Directory are now all the Dependencys you need for your gem

Install Gem on Machine without internet connection:

  • Copy the cache Folder to the Machine
  • Open a Commandline inside the Cache Folder and execute gem install --local Gemname.gem
  • Bsp:

    gem install --local rails-3.2.1.gem

这篇关于下载所有宝石依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆