I created a new Rails API app. I am trying to create the database table for the app with the command for a postgres db 

```
rake db:create:all

```

and Im getting this error:

```
 AM@~/Documents/RailsWS/iosprototypevendors >rake db:create:all --trace
 rake aborted!
 Valid types are [:development, :runtime], not nil
 /usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:52:in `initialize'
 /Users/AM/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler- 1.2.0/lib/bundler/resolver.rb:371:in `new'
 /Users/AM/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-     1.2.0/lib/bundler/resolver.rb:371:in `search'
 /Users/AM/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-
   ..............

```

A bunch of googling I found out that this might have something to do with the wrong version of ruby picked up. 

(I recently upgraded my OS to Mountain Lion and had to upgrade my Rails and Ruby versions to the latest. Went through hell for 8 hrs to get rails up and going. Rails works now on my system but this is one discrepancy that just popped up).

---

In addition

I also noticed that for different rails apps on my system when I check their versions using rails -v the versions of rails sometimes come up as 3.2.1 and other time 3.2.8 and sometimes I get the above error message.

How can this be happenning?
Here is what I get by running this command:

```
rvm info

ruby-1.9.3-p194:

system:
 uname:       "Darwin A-Ms-MacBook-Pro.local 12.1.0 Darwin Kernel Version 12.1.0: Tue Aug 14 13:29:55 PDT 2012; root:xnu-2050.9.2~1/RELEASE_X86_64 x86_64"
 bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)"
 zsh:         "/bin/zsh => zsh 4.3.11 (i386-apple-darwin12.0)"

 rvm:
  version:      "rvm 1.15.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
  updated:      "1 day 22 hours 15 minutes 59 seconds ago"

 ruby:
  interpreter:  "ruby"
  version:      "1.9.3p194"
  date:         "2012-04-20"
  platform:     "x86_64-darwin12.1.0"
  patchlevel:   "2012-04-20 revision 35410"
  full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]"

 homes:
  gem:          "/Users/AM/.rvm/gems/ruby-1.9.3-p194"
  ruby:         "/Users/AM/.rvm/rubies/ruby-1.9.3-p194"

 binaries:
   ruby:         "/Users/AM/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
   irb:          "/Users/AM/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
   gem:          "/Users/AM/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
   rake:         "/Users/AM/.rvm/gems/ruby-1.9.3-p194@global/bin/rake"

 environment:
   PATH:         "/Users/AM/.rvm/gems/ruby-1.9.3-p194/bin:/Users/AM/.rvm/gems/ruby- 1.9.3-p194@global/bin:/Users/AM/.rvm/rubies/ruby-1.9.3-    p194/bin:/Users/AM/.rvm/bin:/Users/AM/.rbenv/shims:/Users/AM/.rbenv/bin:/usr/local/bin:/usr/   local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/PostgreSQL/9.1/bin/"
  GEM_HOME:     "/Users/AM/.rvm/gems/ruby-1.9.3-p194"
  GEM_PATH:     "/Users/AM/.rvm/gems/ruby-1.9.3-p194:/Users/AM/.rvm/gems/ruby-1.9.3-p194@global"
  MY_RUBY_HOME: "/Users/AM/.rvm/rubies/ruby-1.9.3-p194"
  IRBRC:        "/Users/AM/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
  RUBYOPT:      ""
  gemset:       ""

```

Any help is appreciated

EDIT

---

Here is what I get when I run the command 

```
echo $PATH on my terminal

/Users/AM/.rbenv/shims:
/Users/AM/.rbenv/bin:
/usr/local/bin:/usr/local/sbin:
/usr/local/mysql/bin:
/Users/AM/.rvm/gems/ruby-1.9.3-p194/bin:
/Users/AM/.rvm/gems/ruby-1.9.3-p194@global/bin:
/Users/AM/.rvm/rubies/ruby-1.9.3-p194/bin:
/Users/AM/.rvm/bin:
/usr/local/bin:
/usr/bin:/usr/bin:
/bin:/usr/sbin:/sbin:
/usr/local/bin:
/Library/PostgreSQL/9.1/bin/

```

So these are the paths on my system