Install Using Ruby Packaging
gem install
Before installing Asciidoctor using gem install
, you should set up RVM to install Ruby in your home directory (i.e., user space).
Then, you can safely use the gem
command to install or update the Asciidoctor gem, or any other gem for that matter.
When using RVM, gems are installed in a location isolated from the system.
Once you’ve installed Ruby using RVM, and you have activated it using rvm use 2.7
, open a terminal and type:
$ gem install asciidoctor
If the gem installed successfully, Asciidoctor’s command line interface (CLI) will be available on your PATH. To confirm that Asciidoctor is available, execute:
$ asciidoctor --version
You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.
Asciidoctor 2.0.12 [https://asciidoctor.org] Runtime Environment (ruby 2.7.0p0 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
Bundler
-
Create a Gemfile in the root folder of your project (or the current directory)
-
Add the
asciidoctor
gem to your Gemfile as follows:source 'https://rubygems.org' gem 'asciidoctor' # or specify the version explicitly # gem 'asciidoctor', '2.0.12'
-
Save the Gemfile
-
Open a terminal and install the gem using:
$ bundle
To upgrade the gem, specify the new version in the Gemfile and run bundle
again.
Using bundle update
(without specifying a gem) is not recommended as it will also update other gems, which may not be the desired result.
Upgrade using gem update
You’re advised against using the If you want to use a version of Asciidoctor that is newer than what is installed by the package manager, you should use RVM to install Ruby in your home directory (i.e., user space).
Then, you can safely use the |
You can upgrade Asciidoctor using the gem update
command:
$ gem update asciidoctor
If you accidentally use $ gem cleanup asciidoctor |