Seal Seal - 6 months ago 51
Ruby Question

Rails command Error

Im about to start work on another web application, I change directories to


and enter

rails new blank

I then get this error

Error: Command not recognized
Usage: rails COMMAND [ARGS]

The common rails commands available for engines are:
generate Generate new code (short-cut alias: "g")
destroy Undo code generated with "generate" (short-cut alias: "d")

All commands can be run with -h for more information.

If you want to run any commands that need to be run in context
of the application, like `rails server` or `rails console`,
you should do it from application's directory (typically test/dummy).

I have reinstalled rails, and still same error, any ideas?


It actually give me the same error when I type just

rails -h


in cmd


If anyone runs into this error and needs a last resort plan.

I ended up uninstalling rails, rvm, and installing a newer version of ruby and new gemset.

rvm implode
gem uninstall rails -v=4.0.2
gem uninstall railities

install rvm :

curl -L | bash -s
rvm get stable

for mac:

brew install libtool libxslt libksba openssl
brew install libyaml

install ruby:

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr

if you have error

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/opt/openssl

install new ruby gems from website. Unpackage it then go to folder and run

ruby setup.rb
gem update --system 2.1.9

install rails (you can choose your version)

gem install rails --version 4.0.2
gem install railties

I did this, and now system is working normal again.