Ruby Package Manager Gem common commands _ruby topics

Source: Internet
Author: User
Tags documentation

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:

Gem INS Rake

The local installation will be attempted first and will be downloaded remotely if not locally.
Copy Code code as follows:

Gem List-b ^c

Lists local and remote software that starts with C

8. Browse all installed software and their documentation

Copy Code code as follows:

Gem_server

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包

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.