Installing and Running Ruby with Jekyll on Visual Studio Codespaces

Posted by Brian Porter on May 19, 2020

So ruby was not working out of the box, but I wanted to build and test my Jekyll blog directly in Visual Studio Codespaces. After some experimentation, this is what I had to run in the terminal to get everything installed:

sudo apt-get install ruby
sudo apt-get install ruby-bundler
sudo gem install bundler
sudo gem install rubygems-update
update_rubygems
sudo gem update --system
sudo apt-get install ruby-dev
sudo gem install eventmachine -v '1.2.7'

Visual Studio Codespaces - running Jekyll and Ruby

After that your environment should be ready for Jekyll. Then install the bundles, and start Jekyll:

bundle install 
bundle exec jekyll serve

After that it is running, and you can use our other post on port forwarding from Visual Studio Codespaces to access it in your browser.

If you made it this far, you may as well follow me on LinkedIn: Follow Brian Porter