SWIG solves part of your problem: it lets you create Ruby bindings to C++ functions that you've written. The other half of your problem, making a C++ program that can evaluate Ruby code, can be as easy or complicated as you wish.
The easy way is to divide your program into two halves: a ruby-accessible part that lives in a dll, and an inaccessible part that links with that dll and invokes Ruby via system()
.
At a slightly higher level, you can use ruby's C API from C++ to run Ruby code. This gives you better control over how Ruby code is executed, and offers you the opportunity to do things like wrap all executed Ruby in blocks that generate C++ exceptions from Ruby exceptions. The downside here is that you will need to understand Ruby's C API, which is not awful but certainly isn't as friendly as, say, Lua's.
If you want more than that, you're into deep waters. Ruby and C++ are both complicated languages, and getting them to interoperate is a real challenge. Éric Malenfant's link may be of some use to you.