Welcome to the Rails.MN Tutorial of Ruby on Racetracks! Although the Rails.MN group is dedicated to Ruby on Rails, the web site is static and uses Ruby's Jekyll tool instead of Rails.
- You should have version 4 of SparkyLinux installed as your host OS or virtual OS. You may also use any other Linux distro based on Debian Stretch. If you are using a Mac or Windows, you can use a VirtualBox virtual machine with SparkyLinux on it. For more details, go through the VirtualBox Tutorial.
- You should have Docker installed in your SparkyLinux desktop Linux setup. This is covered in chapter 1 of the Docker Tutorial.
- You should be familiar with the Docker way of developing in Jekyll. This is covered in the Docker tutorial.
- You should have an account on GitHub.
- In your browser, log into your GitHub account.
- Go to https://github.com/railsmn/railsmn.github.io.
- Fork the Rails.MN repository.
- Instead of working directly on the main version of the Rails.MN site, you can work on your fork, create a branch, and submit your branch as a pull request.
- Your fork may become outdated. Instructions on how to update your fork are at https://help.github.com/articles/syncing-a-fork/#platform-linux.
- Enter the following commands in a terminal in SparkyLinux:
cd
git clone https://github.com/jhsu802701/docker-debian-stretch.git
cd docker-debian-stretch
- Create the files for using a Docker container based on the rbenv-jekyll Docker image.
- If you are using 64-bit Linux, enter the following command:
sh rbenv-jekyll.sh
- If you are using 32-bit Linux, enter the following command:
sh 32rbenv-jekyll.sh
- Enter the following command to enter the directory for using the development image:
cd rbenv-jekyll
- You will be asked about your desired offset for the port numbers. Enter "0".
- Download the rbenv-jekyll Docker image and start a Docker container based on it by entering the following command:
sh download_new_image.sh
- In a few minutes, you will be automatically logged into the Docker container based on this Docker image.
- In the rbenv-jekyll Docker container, enter the command "tmux" to start a tmux window.
- Enter the following commands:
git clone (URL of your fork)
cd railsmn.github.io
bundle install
rm -rf ./_site
bundle exec jekyll build
bundle exec jekyll serve --host 0.0.0.0
- Once the server is running, go to the URL http://localhost:4000/ in your web browser in SparkyLinux to view your local version of the Rails.MN site.
- NOTE: The ports.txt file in the shared directory shows which ports in desktop Linux correspond to the critical ports in the app in Docker. Port 4000 in Docker equates to port 4000 in the desktop Linux system.
- In the Docker container, press Ctrl-b and then "c" to create a new tmux window.
- Enter the command "cd railsmn.github.io".
- Use this new tmux window (Window 1) for entering commands. The original tmux window (Window 0) is dedicated to the Jekyll server.