Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeship to run grunt with compass

I'm trying to setup continuous integration with codeship. Our project is a Rails API with an angular app which, for now, is in public directory. In order to work, grunt needs to find compass executable.

I would say that setup commands should be:

rvm use 2.1.3 --install
bundle install
export RAILS_ENV=test
bundle exec rake db:schema:load
bundle exec rake db:migrate
bundle exec rake db:test:prepare
# We need compass in frontend
gem install compass
nvm install 0.10.25
nvm use 0.10.25
npm install
npm install -g grunt-cli

And test pipeline:

bundle exec rspec
cd public && grunt test

However, it seems that codeship doesn't like gem install compass line and it complains with:

Running "concurrent:test" (concurrent) task Warning: /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.4.2 in any of the sources

(Bundler::GemNotFound) from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:85:in `map!'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/spec_set.rb:85:in `materialize'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/definition.rb:132:in `specs' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/definition.rb:177:in `specs_for' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler/runtime.rb:13:in `setup'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler.rb:129:in `setup' from /home/rof/.rvm/gems/ruby-2.1.3/gems/bundler-1.9.4/lib/bundler.rb:134:in `require'
from /home/rof/.rvm/gems/ruby-2.1.3/gems/compass-1.0.3/bin/compass:26:in `<top (required)>'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/compass:23:in `load'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/compass:23:in `<main>'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
from /home/rof/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
Use --force to continue.

And it gives me a hint I'm not sure to understand:

Please make sure the gem wasn't yanked from http://www.rubygems.org

However, if I remove gem install compass line and, instead, I add compass to my Rails app Gemfile, it works. But I really feel ugly and bad about adding compass to my Gemfile. It has nothing to do with it. My Rails app is a REST API so it doesn't want to know anything about compass, css or anything like that.

Thanks.

like image 520
Waiting for Dev... Avatar asked Oct 31 '22 03:10

Waiting for Dev...


1 Answers

I had the same issue today and this is how I solved it:

I edited the Setup Commands on Project Settings > Test. This way you can run the command gem install compass before run the grunt task(s).

This is how it looks: Setup Commands screenshot

I hope this works for you too

like image 113
Rodrigo Bournissent Avatar answered Nov 13 '22 06:11

Rodrigo Bournissent