I based this installation from the official arch documentation wiki including a couple specific steps.
Rails requires nodejs package so we need to install nodejs
Now we need to install ruby
Ruby includes RubyGems, RubyGems will install the gems to a directory inside your home directory, something like ~/.gem/ruby/2.1.0 The commands provided by the gems you installed will end up in ~/.gem/ruby/2.1.0/bin. For the programs installed there to be available for you, you need to add ~/.gem/ruby/2.1.0/bin to your PATH environment variable.
So wen can add that directory to our PATH, so fist we need to open ~/.bashrc file
and add the this code
save it, now we need to restart our shell for the changes to take effect. You can do this by opening a new terminal window or by running exec $SHELL in the window you already have open.
now we can proceed with installing rails, but before that, we need to run the following commands as root
and the we can update the gems
we can check all these tools are successfully installed
now wen can start to create our first application:
References: