Rails doesn't work in one directory, but does everywhere else

1

Terminal output:

(^_^) - (vagrant@ubuntu) - (jobs:0) - (~) - (531) 
----> rails

/// Bunch'O Rails stuff, clearly installed ///

(^_^) - (vagrant@ubuntu) - (jobs:0) - (~) - (531) 
----> cd -
/home/vagrant/Development/ksaa

(^_^) - (vagrant@ubuntu) - (jobs:0) - (~/Development/ksaaa) - (532) 
----> rails
The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

Why would this happen? Rails works everywhere, except in this one directory (/home/vagrant/Development/ksaa).

/home/vagrant/Development/ksaa:

drwxr-xr-x 14 vagrant 4.0K 2013-04-11 17:57 .
drwxr-xr-x 15 vagrant 4.0K 2013-04-11 17:57 ..
drwxr-xr-x  8 vagrant 4.0K 2013-04-11 17:57 app
drwxr-xr-x  5 vagrant 4.0K 2013-04-11 17:57 config
-rw-r--r--  1 vagrant  154 2013-04-11 17:57 config.ru
drwxr-xr-x  2 vagrant 4.0K 2013-04-11 17:57 db
drwxr-xr-x  2 vagrant 4.0K 2013-04-11 17:57 doc
-rw-r--r--  1 vagrant  932 2013-04-11 17:57 Gemfile
-rw-r--r--  1 vagrant 3.6K 2013-04-11 17:57 Gemfile.lock
drwxr-xr-x  8 vagrant 4.0K 2013-04-11 17:57 .git
-rw-r--r--  1 vagrant  434 2013-04-11 17:57 .gitignore
drwxr-xr-x  4 vagrant 4.0K 2013-04-11 17:57 lib
drwxr-xr-x  2 vagrant 4.0K 2013-04-11 17:57 log
drwxr-xr-x  2 vagrant 4.0K 2013-04-11 17:57 public
-rw-r--r--  1 vagrant  269 2013-04-11 17:57 Rakefile
-rw-r--r--  1 vagrant 9.1K 2013-04-11 17:57 README.rdoc
-rw-r--r--  1 vagrant   15 2013-04-11 17:57 .rspec
-rw-r--r--  1 vagrant   24 2013-04-11 17:57 .rvmrc
drwxr-xr-x  2 vagrant 4.0K 2013-04-11 17:57 script
drwxr-xr-x  3 vagrant 4.0K 2013-04-11 17:57 spec
drwxr-xr-x  7 vagrant 4.0K 2013-04-11 17:57 test
drwxr-xr-x  4 vagrant 4.0K 2013-04-11 17:57 vendor

sivSivSG

Posted 2013-04-15T19:12:03.493

Reputation: 13

Can you provide a full directory listing? – slhck – 2013-04-15T19:25:59.153

Will do. Edited. – sivSivSG – 2013-04-15T19:29:22.860

Answers

0

If you have an .rvmrc file that means while you're in this folder, you're using a different Ruby (and Gem) version than the system one. This will be one installed through RVM.

I'm fairly certain that in this case, you don't have a Rails Gem yet. Verify this with gem -v and gem list, once run from your directory, and once from anywhere else. You should see different Gem versions.

You should be able to install the Rails Gem simply by running bundle install, which looks at the Gemfile and installs everything that's missing.

If you do have a Rails Gem in your project's Ruby version (the one from RVM), then something's wrong with your RVM configuration. You should however be able to start the Rails server through bundle exec rails.

slhck

Posted 2013-04-15T19:12:03.493

Reputation: 182 472

Would upvote, but I can't. – sivSivSG – 2013-04-15T19:45:42.247

No worries. Once you have enough reputation you can upvote :) Welcome to Super User! – slhck – 2013-04-15T21:16:32.067