Closed mrrooijen closed 11 years ago
The following command does work:
queue "jruby -S bundle install --without development:test"
I don't use the --deployment
flag because it seems to re-install all the gems and seems slow. Installing them without the flag re-uses them on every deploy instantly without re-installing. Though copying over the whole line from the bundle:install
helper but prefixing it with jruby -S
also solves the issue. So it's not a blocker for me, but good to know for other people on JRuby experiencing the issue.
Can anyone help debug why this happens? bundle install --deployment
should technically be fine and just as fast (if not faster) than without it.
Anyway, the better fix would be to set the options for Bundler like so:
set :bundle_bin, "jruby -S bundle"
set :bundle_options, "--without development:test"
This way you don't need to make your own bundle:install
task.
That commit above will also make other commands (like rails:assets_precompile
) respect the bundle_bin
setting, making them run tasks as jruby -S bundle exec rake db:migrate
.
Ah. Sorry I forgot to mention that I actually forgot I had to set the --path
. I just pointed the --path
to shared/vendor/bundle
and the deployments are now fast. Since I forgot to set it, it was re-installing it over and over again.
The current command I am using works fine with JRuby:
queue "jruby -S bundle install --without development:test " +
"--deployment --binstubs ./bin --path #{deploy_to}/#{shared_path}/vendor/bundle"
I don't get any issues any longer, and --binstubs
are pretty much a must since bundle exec
in JRuby should be avoided as JRuby doesn't play nice with forking processes. Example Procfile:
web: source ~/.bashrc; ./bin/trinidad -p $PORT
processor: source ~/.bashrc; ./bin/sidekiq -c 100 -q default
service: source ~/.bashrc; ./bin/clockwork services.rb
Without prefixing the commands with bundle exec
.
The only thing that's still incredibly slow is the asset pipeline, mostly because of JRuby again. So the other issue where assets are being re-compiled when unnecessary would of course be a great help if no front-end related code has changed. Then deployments should be done in a few seconds. JRuby with asset pipeline takes like 90% of the time unfortunately. Which leads up to 90 second deployments.
Looks like there's no issue left here. The other problem (about unnecessary re-compile of assets) has been fixed (#25).
Trying to deploy through JRuby using the provided
bundle:install
task.It keeps saying it can't find certain gems during the precompile stage. Any idea why?