官术网_书友最值得收藏!

Installing Rake

As Rake is a Ruby library, you should first install Ruby on the system if you don't have it installed already. The installation process is different for each operating system. However, we will see the installation example only for the Debian operating system family.

Just open the terminal and write the following installation command:

$ sudo apt-get install ruby

Note

If you have an operating system that doesn't contain the apt-get utility and if you have problems with the Ruby installation, please refer to the official instructions at https://www.ruby-lang.org/en/installation. There are a lot of ways to install Ruby, so please choose your operating system from the list on this page and select your desired installation method.

Rake is included in the Ruby core as Ruby 1.9, so you don't have to install it as a separate gem. However, if you still use Ruby 1.8 or an older version, you will have to install Rake as a gem. Use the following command to install the gem:

$ gem install rake

Note

The Ruby release cycle is slower than that of Rake and sometimes, you need to install it as a gem to work around some special issues. So you can still install Rake as a gem and in some cases, this is a requirement even for Ruby Version 1.9 and higher.

To check if you have installed it correctly, open your terminal and type the following command:

$ rake --version

This should return the installed Rake version.

The next sign that Rake is installed and is working correctly is an error that you see after typing the rake command in the terminal:

$ mkdir ~/test-rake
$ cd ~/test-rake
$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace)

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

主站蜘蛛池模板: 营山县| 龙岩市| 墨江| 聊城市| 历史| 于都县| 兴化市| 北碚区| 行唐县| 贵州省| 冷水江市| 巴林左旗| 乃东县| 阿鲁科尔沁旗| 介休市| 左权县| 岢岚县| 青阳县| 通江县| 宿迁市| 扎赉特旗| 芮城县| 高碑店市| 高尔夫| 且末县| 银川市| 都安| 化隆| 乌恰县| 两当县| 西藏| 文山县| 宜良县| 开阳县| 吉木乃县| 视频| 康乐县| 新安县| 鄂伦春自治旗| 育儿| 邹城市|