1

I wrote a Ruby script that, at some point in its execution, will run bundle install to install gems from a Gemfile. This is the relevant part:

puts "installing gems ..."
puts `bundle install --without production`
puts "gems installed."

What happens here is that although the bundle install command is properly executed, I only see the output in the CLI once all the gems have been installed. Meaning I first get installing gems ... and then it waits and I get all the output lines of bundle install plus the gems installed message together.

Is there a way to display the output of bundle install line by line in real time as it gets executed?

1 Answer 1

1

One option is to use Kernel#system instead of the backticks:

system "bundle install --without production"
Sign up to request clarification or add additional context in comments.

1 Comment

Awesome! It does exactly what I need. I was sure backticks and system were aliases but obviously, I was completely wrong. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.