Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails资产管道-错误的指纹_Ruby On Rails_Asset Pipeline_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails Rails资产管道-错误的指纹

Ruby on rails Rails资产管道-错误的指纹,ruby-on-rails,asset-pipeline,ruby-on-rails-4,Ruby On Rails,Asset Pipeline,Ruby On Rails 4,我的Rails 4应用程序有new.html.erb,它引用了form.html.erb: #app/assets/templates/jobs/new.html.erb ... ... #app/assets/templates/jobs/form.html.erb 我的表格在这里 (is指令) 问题是,当form.html.erb更改时,生产环境仍然加载旧的form.html.erb。发生这种情况可能是因为new.html.erb未被更改,因此具有相同的旧指纹,即指向form.html.e

我的Rails 4应用程序有
new.html.erb
,它引用了
form.html.erb

#app/assets/templates/jobs/new.html.erb
...
...
#app/assets/templates/jobs/form.html.erb
我的表格在这里
(is指令)

问题是,当
form.html.erb
更改时,生产环境仍然加载旧的
form.html.erb
。发生这种情况可能是因为
new.html.erb
未被更改,因此具有相同的旧指纹,即指向
form.html.erb
的旧指纹


Rails处理此问题的方法是什么?

要回答这个问题,如果其他人有此问题,您需要运行以下程序:

rake assets:clean
rake assets:precompile
touch tmp/restart.txt
运行rake任务后,需要重新启动Rack,否则将不会加载新的预编译assest文件