What worked for me (snippet of my travis.yml
):
env:
- TEST_DIRECTORY=spec/models
SPEC_OPTS="--color --profile"
- TEST_DIRECTORY=spec/classes
SPEC_OPTS="--color --profile"
...
script: xvfb-run bundle exec rspec $TEST_DIRECTORY
In case it wasn't clear, the gems listed in the command are gems that are excluded from the uninstallation / cleaning, because they can't be removed.
@brad8711 - if you only want to make the change in test, then don't change the initializer, and add this line of code:
MyApp::Application.config.session_store :active_record_store
Somewhere that is only loaded by the test env. Perhaps config/environments/test.rb
, or spec/spec_helper.rb
.
Only problem is then you'll have a database schema that has different needs in different environments.
I would strongly discourage you from doing this.
If you use it, use it everywhere.
@fabian818, I did not say to do gem install. I said to add the gem to your Gemfile and then bundle install. If you skipped that then you will get the error you got.
I revised it a bit, so not more forking to cat
:
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
source "$rvm_path/scripts/rvm"
RUBY_VERSION=$(< "$PWD/.ruby-version")
RUBY_GEMSET=$(< "$PWD/.ruby-gemset")
rvm $RUBY_VERSION@$RUBY_GEMSET
fi
See my full writeup on the El Capitan Upgrade with Ruby, Homebrew, Java, QT, and other tools on my blog: http://www.railsbling.com/posts/el-capitan-homebrew-ruby-qt5-java/