在Rails 4和Ruby 2.0中使用资产管道的本地机器上一切顺利.但是当部署到heroku时,它显示:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
I, [2013-03-12T03:28:29.908234 #912] INFO -- : Writing /tmp/build_1n6yi8lwna3sj/public/assets/rails-2ee5a98f26fbf8c6c461127da73c47eb.png
I, [2013-03-12T03:28:29.914096 #912] INFO -- : Writing /tmp/build_1n6yi8lwna3sj/public/assets/trash-3c3c2861eca3747315d712bcfc182902.png
I, [2013-03-12T03:28:33.963234 #912] INFO -- : Writing /tmp/build_1n6yi8lwna3sj/public/assets/application-bf2525bd32aa2a7068dbcfaa591b3874.js
I, [2013-03-12T03:28:40.362850 #912] INFO -- : Writing /tmp/build_1n6yi8lwna3sj/public/assets/application-13374a65f29a3b4cea6f8da2816ce7ff.css
Asset precompilation completed (14.36s)
Run Code Online (Sandbox Code Playgroud)
Heroku似乎编译文件,但把它放在/ tmp没有任何错误.我的问题是:
这真的很棒Rubymine允许我们使用Cmd +左键单击来跟踪定义方法的位置并跳转到源文件/位置.
我怀疑是否有热键可以返回,这在有很多文件/标签打开或查看长文件时很有用
我知道这个问题的标题令人困惑,但下面的例子解释了奇怪的行为:
protocol Protocol {
func method() -> String
}
extension Protocol {
func method() -> String {
return "From Base"
}
}
class SuperClass: Protocol {
}
class SubClass: SuperClass {
func method() -> String {
return "From Class2"
}
}
let c1: Protocol = SuperClass()
c1.method() // "From Base"
let c2: Protocol = SubClass()
c2.method() // "From Base"
Run Code Online (Sandbox Code Playgroud)
为什么c1.method()和c2.method()返回相同?为什么method()SubClass不起作用?
有趣的是,在没有声明c2的类型的情况下,这将起作用:
let c2 = SubClass()
c2.method() // "From Class2"
Run Code Online (Sandbox Code Playgroud) class SecondViewController:UIViewController {
required init(coder aDecoder: NSCoder){
super.init(coder: aDecoder)
//Custom logic here
}
}
Run Code Online (Sandbox Code Playgroud)
相当新手的问题:
一个视图控制器(SecondViewController),UIViewController固有的需要一个指定的init函数,如上所述.
在这种情况下,我应该怎么称呼它,因为我不确定"编码器"应该是什么价值?我以前称控制器为:SecondViewController(),但它给出:
Missing argument for parameter 'coder' in call
Run Code Online (Sandbox Code Playgroud)
我理解必须提供编码器参数,但想知道它的价值来自何处.