Track Down Ruby-on-Rails "RunTimeError" - ruby-on-rails

I am new to this Ruby-on-Rails stuff and cannot figure out who to resolve this "RunTimeError"
When I run the following command from /var/www/discourse,
sudo -u www-data RAILS_ENV=production $ruby_path/bundle exec rake db:migrate --trace
...part way through the run, I get the following errors lines...
MiniRacer::RuntimeError: Error: Could not find module `discourse/lib/utilities` imported from `(require)`
JavaScript at missingModule (<anonymous>:247:11)
JavaScript at findModule (<anonymous>:258:7)
JavaScript at requireModule (<anonymous>:24:15)
JavaScript at <anonymous>:26:11
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/mini_racer-0.6.3/lib/mini_racer.rb:228:in `eval_unsafe'
...
Mini_racer is installed.
discourse/lib/utilities is NOT listed in the source code. Click here to view Github source code
Note: Yes, I know that the official way to run Discourse is with Docker. I am trying to figure out how Ruby-on-Rails pieces fall together and Discourse is what I am fiddling with.
Here is the rvm info output...
admin#rortest:/var/www/discourse$ rvm info
ruby-3.1.3:
system:
uname: "Linux rortest 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux"
name: "Debian"
version: "11"
architecture: "x86_64"
bash: "/usr/bin/bash => GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
remote_path: "debian/11/x86_64"
rvm:
version: "1.29.12 (latest)"
updated: "1 hour 11 minutes 18 seconds ago"
path: "/usr/local/rvm"
autolibs: "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."
ruby:
interpreter: "ruby"
version: "3.1.3p185"
date: "2022-11-24"
platform: "x86_64-linux"
patchlevel: "2022-11-24 revision 1a6b16756e"
full_version: "ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-3.1.3"
ruby: "/usr/local/rvm/rubies/ruby-3.1.3"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-3.1.3/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-3.1.3/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-3.1.3/bin/gem"
rake: "/usr/local/rvm/rubies/ruby-3.1.3/bin/rake"
environment:
PATH: "/usr/local/rvm/gems/ruby-3.1.3/bin:/usr/local/rvm/gems/ruby-3.1.3#global/bin:/usr/local/rvm/rubies/ruby-3.1.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-3.1.3"
GEM_PATH: "/usr/local/rvm/gems/ruby-3.1.3:/usr/local/rvm/gems/ruby-3.1.3#global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-3.1.3"
IRBRC: "/usr/local/rvm/rubies/ruby-3.1.3/.irbrc"
RUBYOPT: ""
gemset: ""

Related

rails app with pow and rvm: sudden pow error starting app

Everything was running fine and suddenly (with no changes to the setup) pow can no longer start the app!
Here's my setup:
rails 4.2
rvm 1.28.0 (with .ruby-version and .ruby-gemset)
pow 0.5.0
Here is what I saw in my browser (Chrome)
Here is the pow log:
[Thu Jan 19 2017 19:35:01 GMT-0800 (PST)] ERROR '/Users/john/dev/savvy/aristotle/.powrc' failed to load:
true &&
source '/Users/john/dev/savvy/aristotle/.powrc' > /dev/null &&
env > '/var/folders/jg/_01lx50x3tngs9br0dkmq_mh0000gn/T/pow.91337.1484883301131.60339'
[Thu Jan 19 2017 19:35:01 GMT-0800 (PST)] ERROR stdout:
[Thu Jan 19 2017 19:35:01 GMT-0800 (PST)] ERROR stderr: /Users/john/.rvm/scripts/rvm: line 12: uname: command not found
/Users/john/.rvm/scripts/rvm: line 15: ps: command not found
/Users/john/dev/savvy/aristotle/.powrc: line 2: rvm: command not found
NOTICE that while the pow log says .powrc failed to load, the logged error says rvm: command not found. However rvm was found right before this pow error suddenly occurred.
Here is the .powrc (which was working fine before the error):
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`#`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
fi
Here is my rvm info from within the root of the rails app:
ruby-2.2.1#savvy:
system:
uname: "Darwin flat-top.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
zsh: "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
rvm:
version: "rvm 1.28.0 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "1 hour 52 minutes 59 seconds ago"
path: "/Users/john/.rvm"
ruby:
interpreter: "ruby"
version: "2.2.1p85"
date: "2015-02-26"
platform: "x86_64-darwin14"
patchlevel: "2015-02-26 revision 49769"
full_version: "ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]"
homes:
gem: "/Users/john/.rvm/gems/ruby-2.2.1#savvy"
ruby: "/Users/john/.rvm/rubies/ruby-2.2.1"
binaries:
ruby: "/Users/john/.rvm/rubies/ruby-2.2.1/bin/ruby"
irb: "/Users/john/.rvm/rubies/ruby-2.2.1/bin/irb"
gem: "/Users/john/.rvm/rubies/ruby-2.2.1/bin/gem"
rake: "/Users/john/.rvm/gems/ruby-2.2.1#savvy/bin/rake"
environment:
PATH: "/Users/john/.rvm/gems/ruby-2.2.1#savvy/bin:/Users/john/.rvm/gems/ruby-2.2.1#global/bin:/Users/john/.rvm/rubies/ruby-2.2.1/bin:/Users/john/.rvm/bin:/Users/john/dev/savvy/aristotle/.direnv/bundler-bin:/Users/john/dev/savvy/aristotle/.direnv/bin:/Users/john/dev/savvy/aristotle/.direnv/ruby/bin:/Users/john/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
GEM_HOME: "/Users/john/.rvm/gems/ruby-2.2.1#savvy"
GEM_PATH: "/Users/john/.rvm/gems/ruby-2.2.1#savvy:/Users/john/.rvm/gems/ruby-2.2.1#global"
MY_RUBY_HOME: "/Users/john/.rvm/rubies/ruby-2.2.1"
IRBRC: "/Users/john/.rvm/rubies/ruby-2.2.1/.irbrc"
RUBYOPT: ""
gemset: "savvy"
To the best of my recollection, the error occurred when I was adding routes, controller actions and views for a new feature in this rails app.
Here is what I have tried so far:
Remove the changes to the app I made immediately before the error occurred
Rebuilt the pow symlink
Stopped and started the pow daemon
rvm cleanup all
rvm get stable
reboot
remove and re-install pow
QUESTION: In an operational rails/pow/rvm system with no setup changes, why does pow suddenly fail to start the app?
I'm out of ideas.

RVM, Rails LoadError

I am having a issue getting a new rails project up and running. Its been a while since I've created a new project, but have been working on various work related projects with many different rails/ruby versions (all fine). That said, I just tried to create a new project and when I run rails -v or rails new xxxx for that matter I get:
/Users/trevor/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- /Users/trevor/Desktop/config/boot (LoadError)
from /Users/trevor/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from script/rails:5:in `<main>'
Specifics
ruby -v => ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] * using RVM
which ruby => /Users/trevor/.rvm/rubies/ruby-2.2.2/bin/ruby
gem list => shows all necessary gems (i.e rails, bundler etc)
rvm info =>
ruby-2.2.2:
system:
uname: "Darwin Trevor.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)"
zsh: "/usr/local/bin/zsh => zsh 5.0.8 (x86_64-apple-darwin14.3.0)"
rvm:
version: "rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "2 months 7 days 5 hours 33 minutes 19 seconds ago"
path: "/Users/trevor/.rvm"
ruby:
interpreter: "ruby"
version: "2.2.2p95"
date: "2015-04-13"
platform: "x86_64-darwin14"
patchlevel: "2015-04-13 revision 50295"
full_version: "ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]"
homes:
gem: "/Users/trevor/.rvm/gems/ruby-2.2.2"
ruby: "/Users/trevor/.rvm/rubies/ruby-2.2.2"
binaries:
ruby: "/Users/trevor/.rvm/rubies/ruby-2.2.2/bin/ruby"
irb: "/Users/trevor/.rvm/rubies/ruby-2.2.2/bin/irb"
gem: "/Users/trevor/.rvm/rubies/ruby-2.2.2/bin/gem"
rake: "/Users/trevor/.rvm/rubies/ruby-2.2.2/bin/rake"
environment:
PATH: "/Users/trevor/.rvm/gems/ruby-2.2.2/bin:/Users/trevor/.rvm/gems/ruby-2.2.2#global/bin:/Users/trevor/.rvm/rubies/ruby-2.2.2/bin:/Users/trevor/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:bin:/Users/trevor/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin"
GEM_HOME: "/Users/trevor/.rvm/gems/ruby-2.2.2"
GEM_PATH: "/Users/trevor/.rvm/gems/ruby-2.2.2:/Users/trevor/.rvm/gems/ruby-2.2.2#global"
MY_RUBY_HOME: "/Users/trevor/.rvm/rubies/ruby-2.2.2"
IRBRC: "/Users/trevor/.rvm/rubies/ruby-2.2.2/.irbrc"
RUBYOPT: ""
gemset: ""
What I've Tried
rvm gemset empty, empty the current default gemset
gem install rails
Typically I have different gemsets for every project, I switched to one using 2.2.2 with a different gemset, rails new does not work in that config either.
This line in the error seems strange to me: require': cannot load such file -- /Users/trevor/Desktop/config/boot (LoadError) Why would rails be looking on the desktop/config for a boot file?
Preformed rvm implode, reinstalled rvm, same results. However, I did notice that by changing directories I am able to create new projects. For some reason the error has to do with trying to create a project while in Users/trevor/Desktop.
Figured it out, but wanted to post in case someone else is in the same boat. After I realized rails new would work in other directories, obviously something was going on with creating projects on the desktop.
Bottom line, make sure you have no file/directories in the directory where your running a rails command named script. There are probably other file/directory names that could cause conflict as well.

Weird rails error "permission denied: bin/rails" for old rails apps

I'm getting this error whenever I run rails (or any rails command)
_rails_command:2: permission denied: bin/rails
ONLY when i'm inside some old rails app directory.
In these directories bundle exec rails c command works but rails or even rails -v don't work.
Background:
I keep my coding workspace in dropbox folder.
Now I recently installed Manjaro and hence all the rails apps which I downloaded back from my previous OS I call them old rails app.
In Short:
Rails works fine everywhere except for old rails apps.
bundle exec rails c works fine though.
Ruby versions which I've tried:
2.0.0 (rvm), 2.1.1(rvm), 2.1.1 (system)
Gem Environment :
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/tat/.rvm/gems/ruby-2.0.0-p451#latest
- RUBY EXECUTABLE: /home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
- EXECUTABLE DIRECTORY: /home/tat/.rvm/gems/ruby-2.0.0-p451#latest/bin
- SPEC CACHE DIRECTORY: /home/tat/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/tat/.rvm/gems/ruby-2.0.0-p451#latest
- /home/tat/.rvm/gems/ruby-2.0.0-p451#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/tat/.rvm/gems/ruby-2.0.0-p451#latest/bin
- /home/tat/.rvm/gems/ruby-2.0.0-p451#global/bin
- /home/tat/.rvm/rubies/ruby-2.0.0-p451/bin
- /home/tat/bin
- /usr/local/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/bin
- /usr/bin/core_perl
- /home/tat/.rvm/bin
UPDATE:
Its working fine in bash, the problem seem to be with oh-my-zsh.
Here is my rvm-info (from zsh):
ruby-2.0.0-p451#latest:
system:
uname: "Linux tat-box 3.10.37-1-MANJARO #1 SMP Mon Apr 14 20:56:29 UTC 2014 x86_64 GNU/Linux"
system: "manjaro/0.8.9/x86_64"
bash: "/usr/bin/bash => GNU bash, version 4.3.8(1)-release (x86_64-unknown-linux-gnu)"
zsh: "/usr/bin/zsh => zsh 5.0.5 (x86_64-unknown-linux-gnu)"
rvm:
version: "rvm 1.25.23 (master) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "21 hours 33 minutes 15 seconds ago"
path: "/home/tat/.rvm"
ruby:
interpreter: "ruby"
version: "2.0.0p451"
date: "2014-02-24"
platform: "x86_64-linux"
patchlevel: "2014-02-24 revision 45167"
full_version: "ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]"
homes:
gem: "/home/tat/.rvm/gems/ruby-2.0.0-p451#latest"
ruby: "/home/tat/.rvm/rubies/ruby-2.0.0-p451"
binaries:
ruby: "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/ruby"
irb: "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/irb"
gem: "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/gem"
rake: "/home/tat/.rvm/gems/ruby-2.0.0-p451#latest/bin/rake"
environment:
PATH: "/home/tat/.rvm/gems/ruby-2.0.0-p451#latest/bin:/home/tat/.rvm/gems/ruby-2.0.0-p451#global/bin:/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin:/home/tat/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/home/tat/.gem/ruby/2.1.0/bin:/home/tat/.rvm/bin"
GEM_HOME: "/home/tat/.rvm/gems/ruby-2.0.0-p451#latest"
GEM_PATH: "/home/tat/.rvm/gems/ruby-2.0.0-p451#latest:/home/tat/.rvm/gems/ruby-2.0.0-p451#global"
MY_RUBY_HOME: "/home/tat/.rvm/rubies/ruby-2.0.0-p451"
IRBRC: "/home/tat/.rvm/rubies/ruby-2.0.0-p451/.irbrc"
RUBYOPT: ""
gemset: "latest"
In the directory you mentioned is your rails in executable mode. If not you can apply
chmod u+x bin/rails
and make it executable.
Run
bundle exec rake rails:update:bin
It will update bin/rails and bin/rake files.
So what worked for me, anyone coming across this issue is to run
bundle exec rake app:update:bin
You'll be given a prompt asking if you want to overwrite? The options here are:
Y - yes (default one, just press Enter for it)
n - no (leave current file without changes)
a - all (apply all changes)
q - quit
d - diff
h - help
I chose a and it seemed to work ok.
I have this when I try to use a rails 4.0 version.
So when I try to put bundle exec first, like:
bundle exec rake db:migrate
or
bundle exec rails s
work's.
I had the same issue and here's what helped me.
Open ~/.zshrc and add this
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
The solution for me was:
bundle exec rake rails:update:bin
or just use:
For new rails versions:
bundle exec rake app:update:bin
For old rails versions:
bundle exec rake rails:update:bin

i'm not using rvm correctly - 'forgets' information on new session

I had to reinstall RVM this afternoon and am still struggling with the following problem - when I load a new terminal window (iTerm2 Build 1.0.0.20130624 with zsh 4.3.9 (i386-apple-darwin10.0)), rvm 'forgets' my gemset data.
This is a fairly common issue, but everything I've tried hasn't worked. I've done this (omitting the create as the gemset was already made):
rvm use --default 2.0.0#<gemset_name>
and this obviously doesn't work since I'm using ZSH:
Command: /bin/bash --login
so then i tried this, specifically for ZSH, but that didn't work either - upon opening iTerm I got the following error:
## exec failed ##
argpath=/usr/local/bin/zsh error=No such file or directory
I changed the command in iTerm preferences to
~/.zlogin -l
since I had added this to .zlogin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
that also didn't work, throwing this error:
## exec failed ##
argpath=/Users/<username>/.zlogin error=Permission denied
So I switched the 'Login Shell' back to "" in iTerm preferences (so it would load without errors) and tried this in the command line:
$ source $HOME/.rvm/scripts/rvm
which gave me
source: no such file or directory: /Users/<username>/.rvm/scripts/rvm
so now I'm really confused. why is there no .rvm in my ~ directory?
Finally, here's the result of rvm info upon reopening iTerm:
system:
system:
uname: "Darwin <users>-MacBook-Pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
system: "osx/10.6/i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.21.16 () by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "3 hours 33 minutes 38 seconds ago"
path: "/usr/local/rvm"
homes:
gem: "not set"
ruby: "/usr/local/rvm/rubies/ruby-2.0.0-p247"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/gem"
rake: "/usr/local/rvm/gems/ruby-2.0.0-p247#global/bin/rake"
environment:
PATH: "/usr/local/rvm/gems/ruby-2.0.0-p247#<gemset>/bin:/usr/local/rvm/gems/ruby-2.0.0-p247#global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p247/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/<username>/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.0.0-p247"
IRBRC: "/usr/local/rvm/rubies/ruby-2.0.0-p247/.irbrc"
RUBYOPT: ""
gemset: ""
You have a system installation of rvm - /usr/local/rvm, it is not recommended for basic use (mainly because of the problems you have and many others).
Start with cleaning ~/.zshrc from forced PATH= as it is described in this pull request https://github.com/robbyrussell/oh-my-zsh/pull/1359
Then update RVM:
rvmsudo /usr/local/rvm/bin/rvm get head --auto-dotfiles
and restart computer.
There is problem with system installation that it is loading early and the default ruby is loaded when computer is started, you need to restart computer for the new default to be effective. This problem does not happen when you use user installation of rvm.
optionally
Remove system installation and install rvm for user:
Remove system rvm:
rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm
Restart computer to get rid of environment variables (yes this is required).
Confirm that environment is clear from rvm (should be empty output):
env | grep rvm
Install user rvm:
\curl -L https://get.rvm.io | bash

Error when using rails command "rake db:create:all" - I think its related to version conflict of Ruby

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
It's a know path issue. Check if your path contains the valid gem path. Did you install ruby without rvm as well? Take a look: Path's issue with bundler, to change or not to change?
So I didn't get the answers I was looking for. So after my own research I found out this, (in case4 others have this issue)
Mountain Lion ships with Postgresql and a native ruby version 1.8.7. The current ruby
version is 1.9.3. So once you upgrade to mountain lion upgrade your versions of rails
and ruby as well and makke sure you are running the right versions.
rvm is the version management tool on mountain lion and can update aand download these
for you. See this post here
Also if you install the upgrades you will have multiple versions of ruby and rails on
your computer. So it becomes important to set the right version as a default onyour
system. You must do that each time you open a terminal window by the command to check
the versions first: rails -v and ruby -v or rvm list
then you set the default versions like this rvm --default 1.9.3-p194 this will set the
default for that terminal session. If you want a more permanent setup per project then ]
you will have to create a .rvmrc file in the root of every project and specify the
vcersions there for that project to use. again see the post linked to above.
Ill edit this answer as I find more details. In the meanwhile if this answer helped you please consider voting for it . Thanks

Resources