I assume /~myid/blog/ will be the base address for every routing that
will come to this address.
How can I resolve this problem???
You're web server's virtual host should set /~myid/blog/public as the
site's DocumentRoot. You should be able to set this up in the .htaccess
file that your shared hosting company provides for you.
Typically Apache or Nginx is used as a front-end web server for Rails
applications and something like Phusion Passenger to take care of the
interaction between the web server and the Rails application. Typically
the web servers provided by rails server are not really suitable for
production level deployment on their own. Generally speaking static
assets are delivered by the front-end web server (Apache or Nginx).