Topic: mongrel_rails start doesnt work but ruby script/mongrel_rails start ok

does anyone understand why, from my app/current directory when i run mongrel_rails start (per the directions) i get:
[root@newlinux current]# mongrel_rails start
/usr/bin/mongrel_rails: line 7: require: command not found
/usr/bin/mongrel_rails: line 8: require: command not found
/usr/bin/mongrel_rails: line 9: require: command not found
/usr/bin/mongrel_rails: line 10: require: command not found
/usr/bin/mongrel_rails: line 11: require: command not found
/usr/bin/mongrel_rails: line 12: require: command not found
/usr/bin/mongrel_rails: line 14: module: command not found
/usr/bin/mongrel_rails: line 15: GemPlugin::Plugin: No such file or directory
/usr/bin/mongrel_rails: line 16: include: command not found
/usr/bin/mongrel_rails: line 18: def: command not found
/usr/bin/mongrel_rails: line 19: options: command not found
/usr/bin/mongrel_rails: line 20: [-e,: command not found
/usr/bin/mongrel_rails: line 20: development],: command not found
/usr/bin/mongrel_rails: line 21: [-d,: command not found
/usr/bin/mongrel_rails: line 22: [-p,: command not found
/usr/bin/mongrel_rails: line 23: [-a,: command not found
/usr/bin/mongrel_rails: line 24: [-l,: command not found
/usr/bin/mongrel_rails: line 25: [-P,: command not found
/usr/bin/mongrel_rails: line 26: [-n,: command not found
/usr/bin/mongrel_rails: line 27: [-t,: command not found
/usr/bin/mongrel_rails: line 28: [-m,: command not found
/usr/bin/mongrel_rails: line 29: [-c,: command not found
/usr/bin/mongrel_rails: line 30: [-r,: command not found
/usr/bin/mongrel_rails: line 31: [-B,: command not found
/usr/bin/mongrel_rails: line 32: [-C,: command not found
/usr/bin/mongrel_rails: line 33: [-S,: command not found
/usr/bin/mongrel_rails: line 34: [-G,: command not found
/usr/bin/mongrel_rails: line 35: [,: command not found
/usr/bin/mongrel_rails: line 36: [,: command not found
/usr/bin/mongrel_rails: line 37: [,: command not found
/usr/bin/mongrel_rails: line 38: ]: command not found
/usr/bin/mongrel_rails: line 39: end: command not found
/usr/bin/mongrel_rails: line 41: def: command not found
/usr/bin/mongrel_rails: line 42: syntax error near unexpected token `('
/usr/bin/mongrel_rails: line 42: `      @cwd = File.expand_path(@cwd)'



but if I run ruby script/mongrel_rails start it starts the server and runs fine.

Have issues starting cluster and I think this is the key.

thanks
Joel

Re: mongrel_rails start doesnt work but ruby script/mongrel_rails start ok

That looks really messed up.  I would first try removing the mongrel gem and re-installing it.

Re: mongrel_rails start doesnt work but ruby script/mongrel_rails start ok

This is because the mongrel_rails command that is in your /bin folder does not have the proper path (or any path) to ruby.  mongrel_rails is a ruby script -thus it needs to be parsed by ruby.

I've seen this same problem from some installs, all you need to do to get this to work is the following:

1) open the file /usr/bin/mongrel_rails
(sudo nano /usr/bin/mongrel_rails)

2) Add the following as the top line:
#!/usr/bin/ruby1.8

Verify that "/usr/bin/ruby1.8" is a valid path to ruby

If you did not find mongrel_rails in your /usr/bin folder - find out where it is by doing a:

locate mongrel_rails

Regards,

Charles
http://www.forthecode.com