in order to enable string interpolation you will need to use double quotes in your string. The topic has been covered here: Double vs single quotes
also it would make your code better to read if you refactored it and assigned the parts to variables before joining them together into one string.
so:
host_name = 'stackoverflow.com'
Kernel.system 'curl -I #{host_name}'
will not work whereas
Kernel.system "curl -I #{host_name}"
will