<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruby on rail Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/ruby-on-rail/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 18 Dec 2018 02:33:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Ruby on Rails on Debian 9?</title>
		<link>https://www.osradar.com/how-to-ruby-on-rails-debian-9/</link>
					<comments>https://www.osradar.com/how-to-ruby-on-rails-debian-9/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 19 Dec 2018 02:33:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on rail]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=8370</guid>

					<description><![CDATA[<p>Web development is at its best. More and more developers are targeting this area. Even in universities of informatics, it is very common to teach development technologies for the web. In this sense, Ruby, which is a famous and quite popular programming language, has something to contribute too, Ruby on Rails. So, this post is [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-ruby-on-rails-debian-9/">How to Ruby on Rails on Debian 9?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Web development is at its best. More and more developers are targeting this area. Even in universities of informatics, it is very common to teach development technologies for the web. In this sense, <a href="https://www.ruby-lang.org" rel="noopener">Ruby</a>, which is a famous and quite popular programming language, has something to contribute too, Ruby on Rails. So, this post is about how to install Ruby on Rails on Debian 9.</p>
<p><a href="https://rubyonrails.org/" rel="noopener">Ruby on Rails</a> is a web application development framework that uses Ruby as its programming language. In addition, it is open source and applications are created from the MVC architecture (Model, View, Controller). In short, not only is it free to use, but you can also help make it better.</p>
<p>So, in this post, you will learn to install Ruby on Rails on Debian 9.</p>
<h1>Two ways to install it</h1>
<p>A great advantage of Ruby on Rails is that it can be installed in two possible ways on Debian 9. As you know Debian 9 is a very safe operating system and for many developers, it is the main option to build their applications.</p>
<p>One of the options is to do it from the <a href="https://www.osradar.com/apt-the-ubuntu-package-manager/" rel="noopener">APT</a> package manager. It&#8217;s quite simple and puts Ruby on Rails at a distance command.</p>
<p>The other option is to do it through RVM (ruby version manager), this way is more complex but we can have access to specific versions.</p>
<h1>1. Using APT</h1>
<p>Actually, this way of installing Ruby on Rails on Debian 9 is quite simple to do. It all boils down to the execution of the following command.</p>
<pre class="">:~$ su
:~# apt install ruby rails</pre>
<figure id="attachment_8545" aria-describedby="caption-attachment-8545" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8545" src="https://www.osradar.com/wp-content/uploads/2018/12/1-12.png" alt="1.- Installing Ruby on Rails using APT" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/1-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/1-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/1-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/1-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/1-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/1-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8545" class="wp-caption-text">1.- Installing Ruby on Rails using APT</figcaption></figure>
<p>And that&#8217;s it.</p>
<p>This form of installation, has a big problem, you will not have a new version of the framework. Depending on many factors this can be either a problem or a big problem. It&#8217;s simple, but I don&#8217;t recommend it.</p>
<h1>2. Install Ruby on Rails using the RVM</h1>
<p>In contrast, this method is a little more complicated but believe me it&#8217;s better. In the first place, it is necessary to install some dependencies.</p>
<pre class="">:~# apt install build-essential curl nodejs</pre>
<figure id="attachment_8546" aria-describedby="caption-attachment-8546" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8546" src="https://www.osradar.com/wp-content/uploads/2018/12/2-12.png" alt="2.- Installing some dependencies" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/2-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/2-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/2-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/2-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/2-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/2-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8546" class="wp-caption-text">2.- Installing some dependencies</figcaption></figure>
<p>Next, add the RVM GPG keys.</p>
<pre class="">:~# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -</pre>
<p>Then, use curl to download the RVM installation script. With this script, you will install Ruby.</p>
<pre class="">:~# curl -sSL https://get.rvm.io | bash -s stable --ruby</pre>
<p><img loading="lazy" class="size-full wp-image-8548" src="https://www.osradar.com/wp-content/uploads/2018/12/3-12.png" alt="3.- Installing RVM" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/3-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/3-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/3-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/3-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/3-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/3-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /></p>
<p>3.- Installing RVMThen, make RVM available for the user.</p>
<pre class="">:~# source /etc/profile.d/rvm.sh</pre>
<p>Now, install ruby. So it&#8217;ll take a while.</p>
<pre class="">:~# rvm install ruby</pre>
<figure id="attachment_8549" aria-describedby="caption-attachment-8549" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8549" src="https://www.osradar.com/wp-content/uploads/2018/12/4-12.png" alt="4.- Installing Ruby using RVM" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/4-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/4-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/4-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/4-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/4-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/4-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8549" class="wp-caption-text">4.- Installing Ruby using RVM</figcaption></figure>
<p>After that, check the Ruby version.</p>
<pre class="">:~# ruby -v</pre>
<figure id="attachment_8550" aria-describedby="caption-attachment-8550" style="width: 810px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8550" src="https://www.osradar.com/wp-content/uploads/2018/12/5-12.png" alt="5.- Ruby version" width="810" height="143" srcset="https://www.osradar.com/wp-content/uploads/2018/12/5-12.png 810w, https://www.osradar.com/wp-content/uploads/2018/12/5-12-300x53.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/5-12-768x136.png 768w" sizes="(max-width: 810px) 100vw, 810px" /><figcaption id="caption-attachment-8550" class="wp-caption-text">5.- Ruby version</figcaption></figure>
<p>Now, install Rails.</p>
<pre class="">:~# gem install rails -v 5.2.1</pre>
<figure id="attachment_8551" aria-describedby="caption-attachment-8551" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8551" src="https://www.osradar.com/wp-content/uploads/2018/12/6-12.png" alt="6.- Install Ruby on Rails using RVM" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/6-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/6-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/6-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/6-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/6-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/6-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8551" class="wp-caption-text">6.- Install Ruby on Rails using RVM</figcaption></figure>
<p>Using this command we tell gem to install a specific version of Rails. In this case, I chose the latest stable version at the time of writing this post.</p>
<h1>3. Start a new project</h1>
<p>Now you can start a new project. To do this create the folder where the site will be located. It is important that these commands are not executed by the root user, to avoid permission problems.</p>
<pre class="">:~$ mkdir /home/angelo/example
:~$ cd /home/angelo/example
</pre>
<p>Of course, replace the name and the Path of your project.</p>
<p>Now, create the project. Replace example for your project name.</p>
<pre class="">:~$ rails new example</pre>
<figure id="attachment_8552" aria-describedby="caption-attachment-8552" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8552" src="https://www.osradar.com/wp-content/uploads/2018/12/7-12.png" alt="7.- Creating a new project" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/7-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/7-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/7-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/7-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/7-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/7-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8552" class="wp-caption-text">7.- Creating a new project</figcaption></figure>
<p><em>Note: If you can not use rails command. Just log out and log in again.</em></p>
<p>Then, run the following command to start creating the project as such.</p>
<pre class="">:~$ rails s</pre>
<figure id="attachment_8553" aria-describedby="caption-attachment-8553" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8553" src="https://www.osradar.com/wp-content/uploads/2018/12/9-10.png" alt="9.- A Ruby on Rails project running" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/12/9-10.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/9-10-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/9-10-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/9-10-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/9-10-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/9-10-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8553" class="wp-caption-text">9.- A Ruby on Rails project running</figcaption></figure>
<p><em>Note: you can run <code>bundle install</code> command to install all gem missed. After that, run <code>rails s</code> command again.<br />
</em></p>
<p>Finally, open your web browser and go to <code>http://IP_SERVER:3000</code>. You will see something like this.</p>
<figure id="attachment_8554" aria-describedby="caption-attachment-8554" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-8554" src="https://www.osradar.com/wp-content/uploads/2018/12/10-10.png" alt="10. Ruby on Rails Installed" width="1366" height="671" srcset="https://www.osradar.com/wp-content/uploads/2018/12/10-10.png 1366w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-768x377.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-1024x503.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-1068x525.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/10-10-855x420.png 855w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-8554" class="wp-caption-text">10. Ruby on Rails Installed</figcaption></figure>
<p>And that&#8217;s all.</p>
<h1>Conclusion</h1>
<p>Ruby on Rails is a widely used framework worldwide. Many of the world&#8217;s most famous companies use this framework to design their web applications. Therefore, it is a good idea to learn something about it. Today you learned how to install it on Debian 9.</p>
<p>Please share this post with your friends</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-ruby-on-rails-debian-9/">How to Ruby on Rails on Debian 9?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-ruby-on-rails-debian-9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
