我正在尝试使用 codeship 设置持续集成。我们的项目是一个带有 Angular 应用程序的 Rails API,目前它位于public
目录中。为了工作,grunt 需要找到 compass 可执行文件。
我会说设置命令应该是:
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
和测试管道:
bundle exec rspec
cd public && grunt test
但是,似乎 codeship 不喜欢gem install compass
line 并且它抱怨:
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.
它给了我一个我不确定理解的提示:
Please make sure the gem wasn't yanked from http://www.rubygems.org
但是,如果我删除gem install compass
行,而是添加compass
到我的 Rails 应用程序Gemfile
,它就可以工作。但是我真的觉得在我的 Gemfile 中添加指南针很难看。它与它无关。我的 Rails 应用程序是一个 REST API,所以它不想知道任何关于 compass、css 或类似的东西。
谢谢。