I think so.
You can use rspec for any ruby code: rails, sinatra, writing a gem and even plain ruby code. But you can use this if you want to work on rails https://github.com/rspec/rspec-rails
I'm not very familiar with cucumber, but if you visit its wiki https://github.com/cucumber/cucumber/wiki , you'll find that it can be used in rails, sinatra, Merb, even with other language