I have a Rakefile in which I use to configure an environment for an application, I am having an issue where the Rake task is aborting because a particular Gem is installed in a preciding task.
Please see the Rakefile below, the Rake aborts on the line require 'data_mapper'
within the :configure_db
task, :configure_db
is called by :build
and it's preceding tasks are :bower_install
and :bundle_install
.
ENV['JASMINE_CONFIG_PATH'] = 'spec/js/support/jasmine.yml'
task :bower_install do
system 'bower install'
end
task :bundle_install => :bower_install do
system 'bundle install'
end
task :configure_db => :bundle_install do
require 'data_mapper'
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/vela.db")
require './models/User.rb'
DataMapper.finalize
DataMapper.auto_migrate!
end
desc "Starts the Rack server so we can run our tests"
task :default => :bundle_install do
require 'sinatra'
require 'rspec/core/rake_task'
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
RSpec::Core::RakeTask.new(:spec)
require './app'
system 'rackup -D'
Rake::Task["spec"].invoke
Rake::Task["jasmine:ci"].invoke
end
task :build => :configure_db