Codeship如何运行带有Compass的Grunt?

5

我将尝试与Codeship配合完成持续集成。我们的项目是一个Rails API和一个Angular应用程序,目前位于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 这行代码,并报以下错误:

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中,它就可以工作了。但是我真的对将compass添加到我的Gemfile中感到丑陋和不好。它与此无关。我的Rails应用程序是一个REST API,因此不想知道任何有关compass、css或类似内容的信息。谢谢。

你找到解决方法了吗?我在codeship上也遇到了同样的问题。 - Yogesh Sajanikar
不,它还没有工作 :( - Waiting for Dev...
1个回答

2

今天我也遇到了同样的问题,这是我解决的方法:

我在“项目设置”>“测试”中编辑了“安装命令”。 这样你就可以在运行grunt任务之前运行gem install compass命令。

它看起来像这样: 安装命令截图

希望这对你也有用。


谢谢你的回答...但我已经尝试了设置命令,但没有成功... - Waiting for Dev...

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接