Where they are different in terms of syntax or capability or philosophy, I nearly always prefer ruby.
I find bundler/Gemfile/rvm to be less headachy for project dependency management than pip/requirements.txt/venv.
For me, ruby code is easier and more pleasant to read.
When I need to write a quick bit of temporary code or do some simple data parsing/file management, I nearly always use ruby if it doesn't matter which language I use.
But if I had to choose one of them to learn, I would focus on python -- even with everything I said above and the really long and drawn out (and still unsuccessful) transition to python 3.
Python has much stronger non-web app libraries and perfectly adequate web app libraries and is definitely much more widely supported in academia. Ultimately there are more things you can do with python and more python job opportunities.