Installing Ruby Gems via SSH

Since Ruby is installed on shared servers now, you have the ability to install gems. Learn more information on Ruby Hosting here. 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 learing to Ruby.

Thoughts on “Installing Ruby Gems via SSH

  • 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, (http://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. 

    • 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

  • 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.

    • 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

  • 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.

    • 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

Leave a Reply to InMotionFan Cancel reply