V
V
Viktor Vsk2014-03-31 02:47:19
Ruby on Rails
Viktor Vsk, 2014-03-31 02:47:19

Ruby (Rails, w\o Rails) - how to execute a shell command with a different Gemfile (in a new thread/process)?

There is an application on Rails. I try to call a command from it (with bundle exec) of another application (spawn, popen3, exec, system, ` ... ). Command: middleman deploy, to which I get that middleman-core is not included in the Gemfile, etc.
Both apps are on the same gemset. Everything works from the command line. I made a bash script, running from the application, I get an error, in any other way - everything is fine.
Question: how to understand threads (or processes?) ruby? I was expecting one of the commands (such as exec, which is said to do everything in a new process and not even return) to execute exactly as if I opened a new terminal window.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jj_killer, 2014-03-31
@jj_killer

Well, once in the Gemfile, then you need to: bundle exec middleman deploy
Or, in a new way, push the stub into bin (bundle binstubs middleman-core) and call it like:bin/middleman deploy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question