1U in the C++ is not a string, it is the unsigned number 1. In fact, the code above in C++ could be substituted by:
a = 0;
b = 1U;
c = 2U;
d = 4U;
In ruby you can simply do
> 1 << 0
=> 1 #0001
> 1 << 1
=> 2 #0010
> 1 << 2
=> 4 #0100
But you are not using bytewise operations in ruby unless you have a very good reason for it, right? :-)