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