I am having trouble referencing a file in another directory in my rails app. I have a controller located in my_app/app/controllers/concerns/my_controller with the following line of code:
@value = %x(python ../../lib/assets/python/test.py #{Shellwords.escape(params[:first_name])} 2>&1)
That is running test.py located in my_app/lib/assets/python/test.py with the %x() subshell.
When I reference the file from my desktop, it runs the test.py code correctly. But when I place the script in my lib/assets/python folder I get a cannot find file or directory error.
How should I correctly reference my test.py file so that the %x() command can find it?
%x(...)?