How to run rspec

I’ve just installed spec testing library for ruby using the command (gem
install rspec) but when I try to use it by calling rspec filename.rb I
get the following error :

-bash: rspec: command not found

Any ideas?
Thank you.

Solved.I had to restart terminal!