Looks like you are using Rails 3.
In that case, you should be specifying the gem dependency in your Gemfile.
Remove the lines you have added to your environment.rb or application.rb file and the following to your Gemfile
gem 'shoulda'
or better still, define it as a test environment dependency only, by adding this to your Gemfile:
group :test do
gem 'shoulda'
end