views:

37

answers:

1

So this happens to me regularly, where i have gems that are installed but for some reason my rails app is not finding it...here is my example

my config/environment.rb

config.gem "whenever"

my install

sudo gem install whenever
Password:
Successfully installed whenever-0.6.2
1 gem installed

gem list | grep when
whenever (0.6.2)


script/server 
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
Missing these required gems:
  whenever  

You're running:
  ruby 1.8.7.174 at /usr/local/bin/ruby
  rubygems 1.3.7 at /Users/matt/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.


 gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.4.0]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-10
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.8
     - /Users/matt/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gemcutter.org"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com
     - http://gemcutter.org


$ which gem
/usr/local/bin/gem
$ which ruby
/usr/local/bin/ruby

Does anybody see the issue because i clearly cant even start my server and i know the gem is installed. I am on a macbook pro with Snow leopard by the way...

+1  A: 

Please check you ruby and gem installation :

May be use these commands

 which ruby
 which gem 

and make sure they have the correct path.

Most times people have these problems is that "gem" command installs gems into a different ruby installation instead of the one used by your rails app.

Rishav Rastogi
not sure how that helps ...i updated my post with the outcome..now that i know where they are now what
Matt
Compare the output with a gem that you know is working. Chances are the gem that is working will show a different path.
sosborn