RubyGem

RubyGem定义

Ruby的打包与安装工具,自动下载,安装,搜索依赖并安装,卸载ruby模块。

In the RubyGems world, developers bundle their applications and libraries into single files called gems. These files conform to a standardized format and typically are stored in repositories on the Internet (but you can also create your own repositories if you want).

 

Installing Gems

$gem query --detail --remote --name-matches builder

缩写:

$gem query -d -r -n builder

$gem list -d -r -n --all builder会列举出所有的版本

$gem server启动一个web服务器,默认端口8808。http://localhost:8808

 

$ gem install builder --version '< 1' 安装版本小于指定值的gem

 

Gem的版本问题

$gem install builder --version '<1'指示安装版本号小于指定值

使用时,在require前面要声明使用gem的版本

gem 'builder',  '<1.0'
require 'builder'

版本的判断操作符:

=相同

!=只要不是

>

<

>=

<=

~>

~> 1.4.2

 >1.4.2 but < 1.5.0

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值