# Installing Ruby gems

> Install Ruby gems in your own account with the gem command after setting up your .bash_profile paths.

Source: https://helpcenter.ruachost.com/developers/programming-languages/installing-ruby-gems/

**Installing Ruby Gems**\
Learn how to install Ruby gems on your account with this detailed guide.

**Installing Ruby gems**\
Follow these steps to install gems using the `gem` command-line tool:

1. Log in to your account using SSH.
2. Make sure you are in your home directory:

```bash
cd ~
```

3. Open the **.bash_profile** file in your home directory and ensure it contains the following:

```
#.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# Set paths for Ruby gems:
PATH=$HOME/ruby/gems/bin:$PATH
GEM_HOME=$HOME/ruby
GEM_PATH=$HOME/ruby/gems:/usr/lib/ruby/gems/1.8
export PATH GEM_HOME GEM_PATH
```

4. Save the file.
5. Apply the settings immediately:

```bash
source ~/.bash_profile
```

6. Create a directory for your local gems:

```bash
mkdir -p ~/ruby/gems
```

7. Create a **.gemrc** file in your home directory. Replace **username** with your ruachost.com account username:

```
gemhome: /home/username/ruby/gems
gempath:
- /home/username/ruby/gems
- /usr/lib/ruby/gems/1.8
```

8. Verify the environment settings:

Bash\
gem environment

9. Install a gem:

```bash
gem install gemname
```

Example:

```
gem install sass
```

10. Uninstall a gem:

```bash
gem uninstall gemname
```
