Gem directory not find

Hi All,
I am new in Ruby.This is my first post in this forum and hoping
my problem will get resolved.

[[email protected] ~]# which ruby
/usr/bin/ruby
[[email protected] ~]# which gem
/usr/bin/which: no gem in
(/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin:/usr/local/nz/bin:)
[[email protected] ~]# gem list
bash: gem: command not found
[[email protected] ~]# ruby -v
ruby 1.8.5 (2006-08-25) [x86_64-linux]

How I can install gems? I want to install gems. I am able to run all
ruby scripts like test.rb.

Please help me out.

Thanks!

Checkout rubygems.org find a gem you want to install and do

gem install gem-name

so

gem install rails

as an example. You might need to use sudo so

sudo gem install rails.

Buddy Lindsey
http://www.buddylindsey.com
http://www.twitter.com/buddylindsey

On Tue, Oct 11, 2011 at 8:40 PM, Sam P. [email protected]
wrote:

How I can install gems? I want to install gems. I am able to run all
ruby scripts like test.rb.

Please help me out.

1.) Download a copy of RubyGems’ .tgz release from
http://rubyforge.org/frs/?group_id=126&release_id=46225
2.) Extract someplace convenient.
3.) run “ruby setup.rb” in the directory you extracted RubyGems to.
This step likely needs root permissions.
4.) Verify RubyGems is installed with “gem -v” (or so).

P.S.: IIRC, 1.8.5 and 1.8.6 are EOL, with only 1.8.7 receiving
(security) patches for a few more years, so you should upgrade to
1.8.7 at least, and 1.9.2 (which includes RubyGems!) if possible.


Phillip G.

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz

On Wed, Oct 12, 2011 at 7:52 AM, Sam P. [email protected]
wrote:

Thanks for your reply.
I am getting below error when trying to run setup.rb file.

Well, you’ll have to try different releases of RubyGems until you find
one that works with Ruby 1.8.5. It’d be be better if you could somehow
upgrade to 1.8.7 at a minimum, though.


Phillip G.

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz

Thanks for your reply.
I am getting below error when trying to run setup.rb file.

[[email protected] rubygems-1.8.10]# ruby setup.rb
./lib/rubygems.rb:332: warning: parenthesize argument(s) for future
version
./lib/rubygems.rb:514: warning: parenthesize argument(s) for future
version
./lib/rubygems.rb:30:in require': ./lib/rubygems/deprecate.rb:53: syntax error (SyntaxError) define_method name do |*args, &block| # TODO: really works on 1.8.7? ^ ./lib/rubygems/deprecate.rb:54: syntax error ./lib/rubygems/deprecate.rb:63: syntax error ./lib/rubygems/deprecate.rb:68: syntax error from ./lib/rubygems.rb:30 from setup.rb:27:inrequire’
from setup.rb:27

Thanks!

I’d recommend installing ruby 1.8.7 as well. If the installation is
successful, gems should be installed with it.

  • Henrik

install -c -m 0644 rubygems/digest/sha2.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/digest/sha2.rb
mkdir -p /usr/lib/ruby/site_ruby/1.8/rubygems/ext
install -c -m 0644 rubygems/ext/ext_conf_builder.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/ext/ext_conf_builder.rb
install -c -m 0644 rubygems/ext/configure_builder.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/ext/configure_builder.rb
install -c -m 0644 rubygems/ext/rake_builder.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/ext/rake_builder.rb
install -c -m 0644 rubygems/ext/builder.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb
cp gem /tmp/gem
install -c -m 0755 /tmp/gem /usr/bin/gem
rm /tmp/gem
rm -f /usr/lib64/ruby/gems/1.8/source_cache
Removing old RubyGems RDoc and ri
Installing rubygems-1.3.0 ri into
/usr/lib64/ruby/gems/1.8/doc/rubygems-1.3.0/ri
./lib/rubygems/custom_require.rb:27:in gem_original_require': no such file to load -- rdoc/rdoc (LoadError) from ./lib/rubygems/custom_require.rb:27:inrequire’
from setup.rb:283:in `run_rdoc’
from setup.rb:296
[[email protected] rubygems-1.3.0]# gem list

*** LOCAL GEMS ***

[[email protected] rubygems-1.3.0]# gem -v
1.3.0

I tried many but 1.3.0 looks like installed but gave some error
also…

On Wed, Oct 12, 2011 at 10:16 AM, Sam P. [email protected]
wrote:

How to upgrade ruby 1.8.5 to 1.8.7?

Depends on your operating system, really.

Debian based: aptitude (or apt-get) are your best bet, RHEL/Suse and
derivatives usually use yum, while many Rubyists on *NIX like to use
rvm.beginrescueend.com to manage Ruby installs (and their gems).


Phillip G.

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz

if you’re on windows, use the ruby-installer

Actually - some people still use 1.8.6 for 1.8 features and some use
1.8.7
which is in-between 1.8 and 1.9 and then 1.9 users probably mostly use
1.9.2.

  • Henrik

On Wed, Oct 12, 2011 at 10:24 AM, Phillip G.

OS: Linux dev 2.6.18-238.el5 #1 SMP Sun Oct 19 14:22:44 EST 2010 x86_64
x86_64 x86_64 GNU/Linux

How to upgrade ruby 1.8.5 to 1.8.7?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs