Sunday, May 5, 2024
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 37208  / 2 Years ago, wed, august 10, 2022, 2:21:03

I'm trying to create a command that will open 3 services from the Rails stack, rails s, spork, and autotest. I can run these commands individually by opening 3 terminals, going to the app folder and running them. I can even open 3 new tabs and run the commands on each.



The problem is that they fail when I try to open the tabs via gnome-terminal like so:



gnome-terminal --tab --title="rails s" -e "rails s" --tab --title="spork" -e "spork" --tab --title="autotest" -e "autotest"


Error (for spork and autotest):



There was an error creating the child process for this terminal
Failed to execute child process "spork" (No such file or directory)


Surprisingly it does work for 'rails s' (the tab shows the server running).



Any ideas?


More From » gnome-terminal

 Answers
7

Below is an answer from stackoverflow.com




  1. Add a eval "$BASH_POST_RC" to the end of your .bashrc


  2. Set the BASH_POST_RC environment variable for each tab to that command you like to execute, e.g.: gnome-terminal --working-directory="/home/zardoz/projects/my_rails_app" --tab -e 'bash -c "export BASH_POST_RC="rails server"; exec bash"' --tab -e 'bash -c "export BASH_POST_RC="autotest"; exec bash"'



[#31907] Thursday, August 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
damomnning

Total Points: 422
Total Questions: 90
Total Answers: 106

Location: Mali
Member since Thu, Aug 13, 2020
4 Years ago
damomnning questions
;