我已经将chronic和chronic_duration宝石放在了我的Gemfile中,在volt console中一切都很好。但是,如果我在客户端尝试了什么,我就会得到一个名称错误。我试过要求他们在客户端初始化,但这没有帮助。
有小费吗?
发布于 2015-12-06 12:29:23
为了补充Elia的答案,在Volt中,您可以将use_gem放在config/dependencies.rb中(在docs 这里中)
这确实可以加载慢性病,但是看起来慢性不会在Opal中运行,因为它使用了可变的字符串--我得到了以下错误:
Uncaught NotImplementedError: #<< not supported. Mutable String methods are not supported in Opal.
发布于 2015-12-05 10:19:43
您需要将gem的路径添加到Opal/链轮搜索路径中,以查找文件。
对于宝石来说,有一个很好的助手:
Opal.use_gem "chronic"在初始化过程中,应该尽早在CRuby代码(MRI)中这样做。
https://stackoverflow.com/questions/34053355
复制相似问题