title: how can i convert bytes into base64 using ruby
body: <p>i want to convert bytes into the base64 format using ruby
  i tried this program but am not getting the proper output please help me </p>
  
  <pre><code>require 'base64'
  require 'open-uri'
  str = File.new("/path/to/file.mp3")
  a = Base64.encode64(str.each_byte{|byte| byte})
  puts a
  </code></pre>