You need to specify gem names as Strings. Use 'gem "test"' instead.
This can happen due to syntax error in your Gemfile. Fix the sytax error by manually checking this file. If that does not work delete the lines that you added to result in this problem and copy / paste from a working copy of a Gemfile.