How to Install Ruby Gems via SSH

How to Install Ruby Gems via SSH

Since Ruby is installed on shared servers, including our Ruby Hosting plans, you have the ability to install gems. Gems are software packages that utilize the Ruby framework. Once they are installed, the new functionality can be used for your website. In my example, I will be installing Sass, which is an “extension of css.”

How to Install Ruby Gems

  1. Login to your server via SSH.
  2. Run the following ruby install command. Be sure to replace sass with the actual gem you want to install.

    gem install sass

    You should see a response similar to this, based on the gem you install.

    Successfully installed sass-3.4.2…
    1 gem installed
    Installing ri documentation for sass-3.4.2…
    Installing RDoc documentation for sass-3.4.2…

    In this example, you see the the message “1 gem installed,” along with the documentation.

Congratulations, now you know how to Install a Ruby via SSH using command line! To continue learning, see the Official Ruby Guides. Code Academy is also a good source for learning to Ruby. Plus, check out our Ruby Education Channel for more info!

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

0 thoughts on “How to Install Ruby Gems via SSH

  1. TJ, 

    Please talk to the rest of your team. I got this email last night: 

    I have reviewed your issue with our Support team, and can confirm we unfortunately do not allow the ability to install Gems in the shared hosting environment. The article you reference, (https://www.inmotionhosting.com/support/edu/ruby/installing-gems) is unfortunately out-of-date, and was not taken down as it was supposed to have been. 


    I have submitted a request to have the article removed from our Support Center, and do apologize for the confusion caused. 

    1. Hello Raymond,

      I did find out it is due to the old version of Ruby installed as cPanel still has their systems on 1.9.0. At this time you are correct gems can not be installed on shared servers so we modify the article. I apologize for the inconvenience but thank you for bringing it to our attention.

      Best Regards,
      TJ Edens

  2. This guide really needs to be taken down or updated. Inmotionhosting doesn’t support gem installation on Shared Hosts due to permissioning issues. Without support for the `json` or `mysql` gems, InMotionHosting’s support for Ruby is a joke/exaggeration.

    I’ve been told by multiple support engineers that even installing sass isn’t possible on shared hosting, making this example is completely wrong.

    1. Hello Raymond,

      If you are on a shared server, which one are you on as this should be working as we have not removed any Ruby functionality. I understand that we do not allow rails on our shared platform but being able to install gems should be working.

      Best Regards,
      TJ Edens

  3. I want to build something in ruby, we are on the business pro plan and I want to create a sinatra application. I would like to build a RoR app but it seems it’s not supported.

    How would I update ruby to a newer version? Can I then install sinatra and host an app with a Postgres or mysql (if you don’t have postgres) ?

     

    Thanks for your time.

    1. Hello Tony,

      With frameworks such as Rails or Sinatra, you will need to be on a VPS or Dedicated Serveraccount. Our shared servers do not yet accommodate the frameworks. This is due to cPanel functionality. There is a ticket in the cPanel community to add this, but we have no time frame as to when they will do so.

      Kindest Regards,
      Scott M

Was this article helpful? Join the conversation!