Difference between revisions of "Ruby Installation"

From Wiki
Jump to navigation Jump to search
(clarify use of page)
 
Line 1: Line 1:
ConTeXt scripts used to be written in Perl (phased out), then switched to Ruby and now to Lua. You need to have at least Ruby installed installed, and Perl for mptopdf.
+
ConTeXt MkII scripts used to be written in Perl (phased out), then switched to Ruby and now to Lua. To run [[Mark_II|MkII]], you need to have at least Ruby installed installed, and Perl for mptopdf. For [[Mark_IV|MkIV]] neither are needed.
 +
 
 +
The installation instructions on this page are for Windows. Linux installations normally come with both Perl and Ruby pre-installed. For MacOS, it is easy to get Perl via [https://www.macports.org |Macports] or [https://brew.sh/ |Homebrew], and Ruby comes pre-installed.
 +
 
  
 
You can download Ruby [http://rubyinstaller.rubyforge.org/wiki/wiki.pl here] (automatic installation) or [http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ here] (you need to extract files from zip and add ruby to PATH).
 
You can download Ruby [http://rubyinstaller.rubyforge.org/wiki/wiki.pl here] (automatic installation) or [http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ here] (you need to extract files from zip and add ruby to PATH).

Latest revision as of 09:14, 19 June 2020

ConTeXt MkII scripts used to be written in Perl (phased out), then switched to Ruby and now to Lua. To run MkII, you need to have at least Ruby installed installed, and Perl for mptopdf. For MkIV neither are needed.

The installation instructions on this page are for Windows. Linux installations normally come with both Perl and Ruby pre-installed. For MacOS, it is easy to get Perl via |Macports or |Homebrew, and Ruby comes pre-installed.


You can download Ruby here (automatic installation) or here (you need to extract files from zip and add ruby to PATH).


You can download ActivePerl here and Ruby here (automatic installation) or here (you need to extract files from zip and add ruby to PATH).

After installing them (remember the folder where you've put them!) you have to check if both executables are included in the PATH. Open the command line (Start -> Run ... -> type cmd or command) and check if

perl --version

and

ruby --version

work OK.

If windows complains about "Command not found", go to the Control Panel -> System -> Advanced -> click on the "Environment variables" and choose path in "system variables". Type in the path (e.g. D\Program Files\Perl\bin\;) where the ruby and perl *.exe files are installed. Generally, the installation is automatic. you may not need the above method.

If you get an error similar to invalid multibyte escape from Ruby, you may need to use a version of Ruby earlier than 1.9. There may be other ways to get around this problem; see e.g. http://gnuu.org/2009/11/02/ruby-1-9-encoding-issues-again/.