耙子流产!即使文件成功运行也会出错[Rails]

时间:2015-09-24 15:56:45

标签: ruby-on-rails ruby rake

我在Ruby on Rails应用程序上编写了一个名为testing.rake的非常简单的rake文件,以查看我是否可以从命令行成功运行rake文件。但是当我使用命令" rake testing"来运行我的代码时,输​​出结束时会弹出一个错误,尽管文件中的代码执行成功。

以下是代码和文件截图:

enter image description here

下面是我运行代码时的输出,以及弹出的结果和错误:

enter image description here

如您所见,代码和结果完全没问题。所以,我很困惑为什么还有错误出现?

谢谢!

1 个答案:

答案 0 :(得分:0)

rake任务应该是这样的:

 ---
    title: "Gain Loss Plot - All Samples"
    author: "Gaius"
    date: "Thursday, September 24, 2015"
    output:
      html_document:
        toc: yes
    runtime: shiny
    ---

    In order to more completely visualize how samples might be related, we are going to create a few interactive plots.

    # Samples by Arm

    ```{r loadlibraries, echo=FALSE}
    library(rmarkdown)
    library(graphics)
    library(ggvis)
    library(ggplot2)
    library(plyr)
    library(reshape2)
    library(data.table)
    library(grDevices)
    ```

    ```{r prepdata, echo=FALSE}

    C01p <- data.table(read.delim("~/_2015_CNV/2015-09-23_CCCC_GLredo_rmvdup-missedlowpurity/chr/01p.txt"))
  #LOAD a bunch of other files just like the one above

    C01p[,Chr.Arm := "01p"]
    #Subset all files as shown in the line above

    #bind all files together
    All.Chrom.Stats  <- rbind(C01p,C01q,C02p,C02q,C03p,C03q,C04p,C04q,C05p,C05q,C06p,C06q,C07p,C07q,C08p,C08q,C09p,C09q,C10p,C10q,C11p,C11q,C12p,C12q,C13q,C14q,C15q,C16p,C16q,C17p,C17q,C18p,C18q,C19p,C19q,C20p,C20q,C21q,C22q)

    #Get just data necessary for creating plots
    Prop.Gain.thresh <- All.Chrom.Stats[Prop.Gain > 0.50]
    Prop.Loss.thresh <- All.Chrom.Stats[Prop.Loss > 0.50]
    ```


    ## Proportion Gained, Threshold > 0.5


    ```{r prop.gain, echo=FALSE}
    all_values <- function(x) {
      if(is.null(x)) return(NULL)
      paste0(names(x), ": ", format(x), collapse = "<br />")
    }

    Prop.Gain.thresh %>% 
      ggvis(~Chr.Arm, ~Prop.Gain) %>% 
      layer_points( fill = ~Sample ) %>% 
      add_tooltip(all_values, "hover")
    ```


    ## Proportion Lost, Threshold > 0.5

    ```{r prop.gain, echo=FALSE}
    all_values <- function(x) {
      if(is.null(x)) return(NULL)
      paste0(rev(names(x)), ": ", rev(format(x)), collapse = "<br />")
    }

    Prop.Loss.thresh %>% 
      ggvis(~Chr.Arm, ~Prop.Loss) %>% 
      layer_points( fill = ~Sample, shape = ~Sample ) %>% 
      add_tooltip(all_values, "hover")
    ```

您可以从here

获取更多信息