I am using ruby 2.3, but I need my gems to also be compatible with 2.2
If I put ruby '2.2'
in the Gemfile, bundler complains that my ruby version doesn't match what it says in the gemfile.
Is there any way to specify the ruby version, and ignore what version I am currently using?
You need to install the ruby 2.2
version and use that when running the code. For using multiple rubies on the same machine you should use some sort of ruby environment manager.
Have a look at uru (best option in Windows) or rvm (my personal preference in Linux)