Pratik Khadloya
Pratik Khadloya

Reputation: 12869

jruby pass jvm arguments to rake task

How do i pass jvm arguments like Xmx to a rake task in jruby? Am using rvm and running the rake task "rake db:migrate".

Thanks!

Upvotes: 3

Views: 2585

Answers (2)

Sammy Larbi
Sammy Larbi

Reputation: 3122

Rather that put the entire path, if jruby is already the Ruby you're using (for example, with rvm) such that just typing rake would be using jruby, you can use a double dash to send the arguments to the jvm.

Examples:

bundle exec rake -- -J-Xmx1024m (if you're using bundler)

rake -- -J-Xmx1024m

Upvotes: 7

Pratik Khadloya
Pratik Khadloya

Reputation: 12869

Found it!

jruby -J-Xmx2048m -S /home/prats/.rvm/gems/jruby-1.6.1@myapp/bin/rake db:migrate

Upvotes: 4

Related Questions