RubyGems and ruby versions

D

Denny Britz

Hello,

I am running Ruby 1.92 on Mac OSX, but for some reason rubygems is not
using the correct ruby version.

ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

which ruby
/usr/local/bin/ruby

gem env
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174)
[universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/denny/.gem/ruby/1.8
-
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

I have tried reinstalling ruby and rubygems, but that didn't help. Any
ideas on how I can fix this?

Thank you!
 
R

Rob Biedenharn

Andreas S. wrote in post #950278:

which gem
/usr/bin/gem


In Ruby1.9, rubygems is built-in even though there is still an
external gem command.

How did you install 1.9.2? Did you use rvm?

In any case, you looked at the location of ruby, but not of gem:

which gem # uses your PATH
whereis gem # looks in typical directories

You must have /usr/bin earlier than /usr/local/bin on your PATH.

That ought to fix it.

-Rob

Rob Biedenharn
(e-mail address removed) http://AgileConsultingLLC.com/
(e-mail address removed) http://GaslightSoftware.com/
 
D

Denny Britz

So I guess I can use /usr/local/bin/gem instead. But when I type a gem
name such as "rake" the system will still look in /usr/local/bin for it.
How can I change that?
 
D

Denny Britz

I think I installed ruby from source, I don't quite remember. I now put
/usr/local/bin before /usr/bin in my path, which works. However, when I
try to run a rake tasks I get the following error:

rake db:seed
/usr/local/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find
executable rake for rake-0.8.7 (Gem::Exception)
from /usr/local/bin/rake:19:in `<main>'
 
R

Rob Biedenharn

I think I installed ruby from source, I don't quite remember. I now
put
/usr/local/bin before /usr/bin in my path, which works. However,
when I
try to run a rake tasks I get the following error:

rake db:seed
/usr/local/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find
executable rake for rake-0.8.7 (Gem::Exception)
from /usr/local/bin/rake:19:in `<main>'

Does this give you any clues? (If not, post the output for all to see)

which gem
which rake
gem env
gem list -d rake

If the last one doesn't show you the rake gem where you'd expect to
find it, you might have to re-install the rake gem using the proper
gem executable.

-Rob

Rob Biedenharn
(e-mail address removed) http://AgileConsultingLLC.com/
(e-mail address removed) http://GaslightSoftware.com/
 
Y

Yabachi Yabachi

Hey,
I'm new to linux and RoR.
I installed ruby from source. Created my first project and executed:
rake db:migrate and received this error.

Error:
/usr/local/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find
executable rake for rake-0.8.7 (Gem::Exception)
from /usr/local/bin/rake:19:in `<main>'

Having searched extensively on this problem - I am yet to find a
solution. Can someone please help.

Thanks.

Additional info:

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/mechanic/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top