GEM-related commands use
1. Show help and version of Gem
Copy Code code as follows:
Gem–h/--help
#显示gem的帮助
Gem–v/--version
#显示gem的版本号
2. List all available software for the remote library
Copy Code code as follows:
Gem Query--remote
# Short Command: Gem q-r
You can see a detailed list of all the software on the remote host.
3. Find specific software on a remote host
Copy Code code as follows:
Gem Query--remote--name-matches Doom
# Short Command: Gem Q-rn Doom
You will see a detailed list of matching doom.
Copy Code code as follows:
Gem List–remote--d
#用子命令list列出远程安装的gems
4.1 Installing a remote software
Copy Code code as follows:
Gem Install--remote ProgressBar
# Short Command: Gem i-r progressbar–y
Remote Installation ProgressBar to your host,-y means unconditional installation of the dependency pack
Copy Code code as follows:
Gem Install Rails–remote
#从远程服务器安装rails包, where rails can be replaced with packages shown in any gem list–remote–d
4.2 Installing specific versions of the software
Copy Code code as follows:
Gem Ins-r progressbar-0.0.3
Install the ProgressBar version 0.0.3
Copy Code code as follows:
Gem ins-r ProgressBar--version ' > 0.0.1 '
The latest version of ProgressBar that is greater than 0.0.1 will be installed
5. View an installed software
Copy Code code as follows:
GEM Specification ProgressBar
# Short Command: Gem spec ProgressBar
You will see detailed information about the installed package ProgressBar.
6. Uninstall a software
Copy Code code as follows:
Gem Uninstall ProgressBar
Uninstall the ProgressBar
7.1 List of all installed software
Copy Code code as follows:
Gem Query--local
# Short Command: ' Gem q-l '
7.2 View an installed software
Copy Code code as follows:
Gem Query--local--name-matches Doom
# Short Command: ' Gem Q-ln Doom '
Or: Gem list--local
7.3 Installation methods to be aware of
Copy Code code as follows:
The local installation will be attempted first and will be downloaded remotely if not locally.
Copy Code code as follows:
Lists local and remote software that starts with C
8. Browse all installed software and their documentation
Copy Code code as follows:
A Web server will be generated to open the http://localhost:8808
You can see an HTML detailing the information you need.
9. Using the configuration file
Copy Code code as follows:
Gem:--gen-rdoc--run-tests
If you want to install the software and always generate their documentation and run unit tests, you can write the relevant commands in the configuration file, the profile name is. GEMRC, in the home directory.
10. Build a Gem Package
Copy Code code as follows:
Gem Build Package.gemspec
#运用bulid子命令构建gem包