Ruby Gems won't run -


I am trying to run different gems on raspben and they will not work. I tried two gems: Jakeel and Lolkut

I have installed two gems:

pi @ moon ~ $ sudo gem install lolcat successfully installed lolcat-42.0.99 1 gi for lolcat-42.0 ri Installing the document .99 ... to install the RDoc documentation for lolcat-42.0.99 ... pi @ moon ~ $ sudo gem install jekyll successfully installed jekyll-1.4.3 install 1 gem install re-documentation for jekyll-1.4.3 Doing ... Installing RDoc Documentation for Jekyll-1.4.3 ...

These are the errors that I receive.

  pi @ moon ~ $ lolcat --help / usr / Lib / ruby ​​/ 1.9.1 / rubygems / dependency.rb: 247: In `to_specs': lollcat (& gt; = 0) can not be found in [bundler1.5.3, bundler-unload -1.2.2, executive-hook-1.3.1, gem-wrapper -1.2.4, RubyGames-bundler-1.4.4, RVM-1 1.1.3.9] (Gem :: Load Errator) /usr/lib/ruby/1.9.1/rubygems/dependency.rb From: 256: / usr / local / bin / lolcat in `gem '/ usr / lib / ruby /1.9.1/rubygems.rb1231: in / `to_spec 'in: 22:` & lt; Main & gt; Pi @ moon ~ $ jekyll /usr/lib/ruby/1.9.1/rubygems/dependency.rbaxy47:in 'to_specs': Between jacile (& gt; = 0) [bundler-1.5.3, bundler- unload -1.0 .2, Executive-hook-1.3.1, Gem-wrapper -1.2.4, RubyGames-Bundler-1.4.4, RVM-1.1.1.3.9] (Gem: Load Errors) / usr / lib / ruby ​​/ 1.9. 1 / RubyGames / Dependencies. Rb: 256: /usr/lib/ruby/1.9.1/rubygems.rb:1231: `` `` 'Gem' in `to_spec '/ usr / local / bin / jekyll: 22:` & lt ; Main & gt; In ' 

I was advised to re-establish Ruby using RVM. I did, and when I run rvm list to see my Ruby version, I get the following:

  pi @ moon ~ $ rvm list rvm rubies = Gt; Ruby-1.9.1-P431 [armv6l] * Ruby-2.0 [armv6l]  

I tried to run gems on both versions (1.9.1 and 2.1.0) but received the same Errors

Thank you in advance!

Many things were wrong here:

First of all, as gems root , Which meant that their codebase (and any shell script or binary command to prepare their installation) was root, and not the current user was the reason for the original failure of OP - that is, executable script gems Could not solve because they could not use a different user's RVM environment Under were established.

Secondly, all types of security problems, given that the files were root, potentially, if these gems were the underlying poorly executed code (or malicious code) between them, then Probably a privilege increase against the system running Ruby Process may be possible.

Basically, TL; DR that you should always install gems using the credentials of the user running the gemstone process, and this user should never be root or for system or file system Superuser rights should not be. / P>


Comments