5

私は卒業プロジェクトの GEM を開発していますが、Travis CI のビルドは常に失敗しています。

これは Travis に関する私のリンクです: https://travis-ci.org/ricardobond/perpetuus/builds/8709218

ビルドのエラーは次のとおりです。

$ bundle exec rake
rake aborted!
Don't know how to build task 'default'
/home/travis/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
/home/travis/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
The command "bundle exec rake" exited with 1.
Done. Your build exited with 1.

以下は私のperpetuus.gemspec

# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'perpetuus/version'

Gem::Specification.new do |spec|
  spec.name          = "perpetuus"
  spec.version       = Perpetuus::VERSION
  spec.authors       = ["Ricardo Caldeira"]
  spec.email         = ["ricardo.nezz@gmail.com"]
  spec.description   = %q{A continuous deploy GEM}
  spec.summary       = %q{Built on top of Ruby on Rails}
  spec.homepage      = ""
  spec.license       = "MIT"

  spec.files         = `git ls-files`.split($/)
  spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
  spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
  spec.require_paths = ["lib"]

  spec.add_development_dependency "bundler", "~> 1.3"
  spec.add_development_dependency "rake"
end

そして、ここに私のGemfileがあります:

source 'https://rubygems.org'

# Specify your gem's dependencies in perpetuus.gemspec
gemspec

group :development, :test do
  gem "rspec", "~> 2.13"
end

任意のヒント?

Mac OS と RVM 1.19.1 で Ruby 2.0.0 を使用しています。

4

2 に答える 2

7

にデフォルト タスクが設定されていませんRakefile。Travis にテスト スイートを実行させたい場合は、おそらく Rakefile に次のようなものを追加する必要があります。

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec

rakeプロジェクト ディレクトリで実行することにより、この構成をローカルでテストできます。

于 2013-07-03T20:36:19.487 に答える
3

デフォルトのタスクがありませんRakefile

普段走っていると仮定すると

rake test

spec を実行するには、ファイルの最後にこれを追加するだけです:

task :default => [:test]

理論的には、代わりに編集.travis.ymlして、実行するもの以外のものを与えることができますrake

script: "bundle exec rake spec:travis"

. . . ただし、デフォルトの Rake タスクを追加する方が簡単です。

于 2013-07-03T20:36:11.300 に答える