How to run Ruby Gem?

This may sound silly, but I recently tried installing SASS and following their instructions:

$ gem install sass $ sass --watch [...] 

So, I followed him:

 root@server:~# gem install sass Successfully installed sass-3.1.15 1 gem installed Installing ri documentation for sass-3.1.15... Installing RDoc documentation for sass-3.1.15... root@server:~# sass bash: sass: command not found 

Despite looking around like an idiot, trying to find some simple way to run something like gem run sass or some other workaround to make it work, I more or less don't understand.

+10
ruby sass rubygems
source share
3 answers

Debian / Ubuntu seems to be throwing ruby ​​gems at /var/lib/gems/1.8/bin .

So the solution (at least for Ubuntu / Debian):

 $ sudo -s # echo 'PATH=/var/lib/gems/1.8/bin:$PATH' > /etc/profile.d/gemspath.sh # chmod 0755 /etc/profile.d/gemspath.sh 

... and then open a new shell session.

(This is fixed in Ubuntu 11.10 .)

+10
source share

If you installed Ruby via rbenv , you need to run the following command

rbenv rehash

+6
source share

If you are using macOS and you:

  • I don't know / don't worry about Ruby.
  • I just want to run this program.
  • Why is it so hard?

Then run:

~/.gem/ruby/*/bin/jekyll

where jekyll is what you just installed with gem install .

0
source share

All Articles