gpt4 book ai didi

ruby-on-rails - 在 HAML 4 中过滤“咖啡未定义错误

转载 作者:行者123 更新时间:2023-12-04 17:23:15 24 4
gpt4 key购买 nike

出于某种原因,我部署的 Rails 应用程序现在给我一个:

Haml::Explore#index 错误

过滤器“咖啡”未定义。

...更新到最新版本的 rails 和最新的 haml 4 之后。

在本地,我没有收到此错误。 Haml 版本 4 应该支持咖啡过滤器。所有其他过滤器似乎都可以正常工作。

这是部署服务器上的包列表:

actionmailer (3.2.12)
actionpack (3.2.12)
activemodel (3.2.12)
activerecord (3.2.12)
activeresource (3.2.12)
activesupport (3.2.12)
addressable (2.3.2)
anjlab-bootstrap-rails (2.3.0.0)
arel (3.0.2)
aws-sdk (1.3.9)
bcrypt-ruby (3.0.1)
builder (3.0.4)
bundler (1.2.1)
capistrano (2.14.2)
cocaine (0.4.2)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
devise (2.2.3)
erubis (2.7.0)
execjs (1.4.0)
faraday (0.8.5)
font-awesome-sass-rails (3.0.2.1)
haml (4.0.0)
haml-rails (0.4)
hashie (1.2.0)
highline (1.6.15)
hike (1.2.1)
httparty (0.10.2)
httpauth (0.2.0)
i18n (0.6.1)
journey (1.0.4)
jquery-fileupload-rails (0.4.0)
jquery-rails (2.2.1)
json (1.7.7)
jwt (0.1.5)
kgio (2.8.0)
koala (1.6.0)
mail (2.4.4)
mime-types (1.21)
multi_json (1.6.1)
multi_xml (0.5.3)
multipart-post (1.1.5)
mysql2 (0.3.11)
net-scp (1.1.0)
net-sftp (2.1.1)
net-ssh (2.6.5)
net-ssh-gateway (1.2.0)
nokogiri (1.5.6)
oauth2 (0.8.0)
omniauth (1.1.3)
omniauth-facebook (1.4.1)
omniauth-oauth2 (1.1.1)
orm_adapter (0.4.0)
paperclip (3.4.0)
paperclip-remote (0.5.0)
polyamorous (0.5.0)
polyglot (0.3.3)
rabl (0.8.0)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.12)
railties (3.2.12)
raindrops (0.10.0)
rake (10.0.3)
rdoc (3.12.1)
right_aws (3.0.4)
right_http_connection (1.3.0)
rmagick (2.13.2)
rocket_tag (0.5.6)
sass (3.2.5)
sass-rails (3.2.6)
sprockets (2.2.2)
squeel (1.0.16)
sugar-rails (1.3.7)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
twitter-text (1.5.0)
tzinfo (0.3.35)
uglifier (1.3.0)
unicorn (4.6.0)
uuidtools (2.1.3)
warden (1.2.1)
will_paginate (3.0.4)

简单的咖啡过滤器:

%html
...
:coffee
alert "hello"

最佳答案

首先,确保您使用的是 execjs生产中的兼容运行时。如果您要部署到 Window 或 Mac OS,或者您在生产环境中安装了 node.js,应该没问题。

然后,确保在添加任何 gem 后重新启动生产中的应用程序。似乎只有在生产环境中重新启动服务器后才会加载咖啡过滤器(请参阅 https://github.com/paulnicholson/coffee-filter/issues/6 )。

关于ruby-on-rails - 在 HAML 4 中过滤“咖啡未定义错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14945135/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com