Ruby vs Javascript
tl;dr
Use both.
tl;dr +1
Use ruby for backend and javascript for frontend.
tl;dr +2
Ruby is excellent for writing very semantic code and handling backend operations via ruby frameworks such as Rails, Sinatra, etc. Javascript creates far greater front-end functionality and can be used in conjunction with ruby frameworks or with solely with a javascript framework
The whole story
The current climate of javascript vs ruby frameworks is a bit volatile. Ruby on Rails can typically create more stable apps at a faster rate of development than current javascript frameworks such as Angular, Ember, or even the 'MEAN' stack of frameworks. However, these javascript frameworks are currently trumping rails in user experience. In response, many developers are currently building apps with both frameworks. A javascript framework is often found handling the front-end of the application while rails continues to support the back-end. Although this does tend to create a larger, more complicated codebase, it does result in the best of both worlds. So the current short answer to ruby vs. javascript is "use both".