2

rails s

command creating new project inside project directory instead of starting server.

I installed rails in my system but it is showing unexpected behavior, as creating project instead of starting server.

I see in my system by running gem list | grep rails command it shows rails 3.2.11 but when I see using rails -v then it shows rails 2.3.11

SO on running rails s it picks rails 2

Taimoor Changaiz
  • 10,250
  • 4
  • 49
  • 53

3 Answers3

7

Please check Your version of rails. It is definitely < 3.

So use ruby script/server instead of rails s.

sjain
  • 23,126
  • 28
  • 107
  • 185
Babasaheb Gosavi
  • 7,735
  • 1
  • 14
  • 14
0

You will be running the first version of rails that is found in your PATH. You can always change your path environment variable so it finds rails 3.2.11 first, but if you are trying to manage several versions of rails/ruby on your system I recommend you use rvm or rbenv.

boulder
  • 3,256
  • 15
  • 21
0

Thanks @Gosavi and @boulder

Your solutions are also worthy, but my prbolem was resolved doing this

My app was poiniting to default gemset so I created new gemset for my app

To create new gemset

rvm --rvmrc --create 1.9.3@project_name

To list avaliable gemsets:

rvm gemset list
Taimoor Changaiz
  • 10,250
  • 4
  • 49
  • 53