Stephen Belanger
Stephen Belanger

Reputation: 6361

Start Rails server with an absolute path

I'm trying to make a script to run my Rails dev server, but the absolute path doesn't want to work.

This is what I've got;

/home/me/dev/app/script/rails server >> /var/log/rails.output.log

It just throws an error saying,

"configuration /home/me/config.ru not found"

It appears that Rails is using the current working directory to get it's paths, rather than the script location.

Is there a way to force the app path?

Upvotes: 3

Views: 5189

Answers (3)

fl00r
fl00r

Reputation: 83680

as an alternative:

ruby /home/me/dev/app/script/rails s -c /home/me/dev/app/config.ru -P /home/me/dev/app/tmp/pids/server.pid >> /var/log/rails.output.log

Upvotes: 2

Rex Morgan
Rex Morgan

Reputation: 3029

I thought maybe rails server had an option you could pass to it, to change the path, but it doesn't look like that's the case.

You are able to pass a -c flag and specify your own configuration, maybe that has something to do with it?

Upvotes: 0

Aaron Hinni
Aaron Hinni

Reputation: 14716

Try:

cd /home/me/dev/app && script/rails server >> /var/log/rails.output.log

Upvotes: 5

Related Questions