{"id":10533,"date":"2021-09-28T10:17:47","date_gmt":"2021-09-28T10:17:47","guid":{"rendered":"https:\/\/linuxways.net\/?p=10533"},"modified":"2021-09-28T10:17:47","modified_gmt":"2021-09-28T10:17:47","slug":"how-to-install-middleman-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-middleman-on-ubuntu-20-04\/","title":{"rendered":"How to Install MiddleMan on Ubuntu 20.04"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>MiddleMan static site generator is based on ruby scripts. It uses the power of ruby scripts to turn simple files and folders into fully responsive websites. It does not have any prerequisites except ruby itself. MiddleMan uses markdown and ruby templates to generate static websites. Today I am going to show you how to install, make use of the MiddleMan, and remove it from your computer in this guide. I have Ubuntu 20.04 LTS installed for this guide. All instructions apply to Ubuntu systems only.<\/p>\n<h2>Prerequisites<\/h2>\n<p>You will need full ruby installation to keep MiddleMan running smoothly on your system.<\/p>\n<p>If you have not yet installed ruby on your system then use the following commands to create a full ruby environment for this guide.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<pre><strong>$ sudo apt install ruby-full<\/strong><\/pre>\n<p>MiddleMan requires a minimum of 2.6 versions of ruby\u2019s programming language to begin working. The rest of the things are installed along with MiddleMan.<\/p>\n<h2>Installing MiddleMan<\/h2>\n<h3><strong>Step 1. Initiate the Installation<\/strong><\/h3>\n<pre><strong>$ gem install middleman<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"411\" height=\"57\" class=\"wp-image-10534\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-572.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-572.png 411w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-572-300x42.png 300w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/p>\n<p>The installation process will begin installing MiddleMan and related ruby gems.<\/p>\n<p>As soon as installed, you will get a success message from the ruby center as shown below and you will be good to go then.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"128\" class=\"wp-image-10535\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-573.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-573.png 726w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-573-300x53.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/p>\n<h3><strong>Step 2. Create a MiddleMan Skeleton<\/strong><\/h3>\n<p>Now you are ready, to begin with, your website development process. I will show you how to build a MiddleMan skeleton in the existing directory. Here are the commands:<\/p>\n<pre><strong>$ middleman init myNewSite<\/strong><\/pre>\n<p>This command creates a new folder and initializes MiddleMan into it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"416\" class=\"wp-image-10536\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-574.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-574.png 726w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-574-300x172.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/p>\n<h3><strong>Step 3. Build MiddleMan<\/strong><\/h3>\n<p>Now I will change the directory and build the middleman. It is the simplest process throughout the guide.<\/p>\n<pre><strong>$ cd myNewSite<\/strong><\/pre>\n<pre><strong>$ bundle exec middleman build<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"132\" class=\"wp-image-10537\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-575.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-575.png 566w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-575-300x70.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/p>\n<h3><strong>Step 4. Preview and Deployment<\/strong><\/h3>\n<p>At this point, you have already produced a successful build of your website. Next, we will make an awesome deployment, but first, we need to make sure that everything is working well.<\/p>\n<p>Use the following build command to run a local server to preview the produced website.<\/p>\n<pre><strong>$ bundle exec middleman server<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"109\" class=\"wp-image-10538\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-576.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-576.png 727w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-576-300x45.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/p>\n<p>Now the preview website can be seen. It is also ready to be deployed on the server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"541\" class=\"wp-image-10539\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-577.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-577.png 741w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-577-300x219.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/p>\n<p>You can access the developed website or application on <a href=\"http:\/\/ubuntu.local:4567\/\">http:\/\/ubuntu.local:4567<\/a><\/p>\n<h3><strong>Step 5. Remove MiddleMan<\/strong><\/h3>\n<p>In any case, if you want to remove MiddleMan from your system simply run the following command. It will be removed for good.<\/p>\n<pre><strong>$ gem remove middleman<\/strong><\/pre>\n<h2>Conclusion<\/h2>\n<p>Throughout the guide, I worked on the installation of ruby, middleman, and related gems that are enough to kickstart your new website. You installed MiddleMan using ruby stack on Ubuntu 20.04 LTS. You have also learned how to run and remove MiddleMan. If you have any questions, you can ask us here without hesitation. We will be delighted to respond.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction MiddleMan static site generator is based on ruby scripts. It uses the power of ruby scripts to turn simple files and folders into fully responsive websites. It&hellip;<\/p>","protected":false},"author":1,"featured_media":10661,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[568,100],"class_list":["post-10533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-middleman","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10533"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10533\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10661"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}