每当gem使用puts语句但是打破更多代码

时间:2017-04-26 21:21:01

标签: ruby-on-rails ruby ruby-on-rails-5 whenever

我已经获得了随时使用简单的puts语句的gem:

schedule.rb

Sub VBA_DataSorting()
Dim i As Integer
Dim j As Integer
Dim temp As Double ' must be double to contain fractional values
Dim rng As Range
Set rng = Range("A1").CurrentRegion 'Range of data to be sorted
For i = 1 To rng.count
    For j = i + 1 To rng.count
    If rng.Cells(j) < rng.Cells(i) Then  ' sort smallest to largest
    'swap numbers
    temp = rng.Cells(i)
    rng.Cells(i) = rng.Cells(j)
    rng.Cells(j) = temp
    End If
Next j
Next i
End Sub

的lib /任务/ scheduler.rb

set :environment, "development"
set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"}

every 1.minutes do
    rake "test_printing"
end

出于某种原因,它不会创建新团队。这是日志:

task :test_printing => :environment do
  puts "SOME OUTPUT BEFORE CREATE CALL"
  Team.create name: DateTime.now
  puts "SOME OUTPUT AFTER CREATE CALL"
end

我尝试自己运行rake任务,而不管它是否完美。我该如何解决这个问题?

0 个答案:

没有答案