Paul A Jungwirth
Paul A Jungwirth

Reputation: 24541

Pass arguments to Ruby when running Rails

When I run rails server, rails console, rails runner, etc., I want to pass some command-line switches to the Ruby binary. (In my case it's JRuby and I want to make sure Java starts up with more memory, but this question seems like it could apply to any Ruby implementation.) Surprisingly I can't find any documentation about this. Anyone know how to do it?

Upvotes: 0

Views: 465

Answers (2)

rogerdpack
rogerdpack

Reputation: 66711

Try this:

  jruby --args -S rails ...

Upvotes: 1

Reactormonk
Reactormonk

Reputation: 21690

Use the JRUBY_OPTS env variable as in

JRUBY_OPTS="-J-Xmn512m" rails server

Upvotes: 1

Related Questions