Tag: execjs

使用javascript_include_tag在rails 3.2.8引擎中执行ExecJS :: RuntimeError

我们将两个轨道3.2.8引擎放在一个轨道应用程序中。 问题是ExecJS不喜欢布局文件中javascript_inclide_tag的命名空间。 这是导致错误的标记: 这里authentify是rails引擎名称。 错误是: ExecJS::RuntimeError in Authentify/sessions#new Showing C:/D/code/rails_proj/engines/authentify/app/views/layouts/sessions.html.erb where line #6 raised: (in C:/D/code/rails_proj/engines/authentify/app/assets/javascripts/authentify/sessions.js.coffee) Extracted source (around line #6): 3: 4: Login 5: 6: 7: 8: 9: 如果我们删除名称空间authentify( ),则ExecJS错误消失并且rails应用程序正常工作。 使用js标记的另一个rails引擎存在相同的错误。 我们正在使用Windows环境。 什么可能导致错误? 谢谢您的帮助。 更新: 在engine.rb for authentify中,每个js库都列为: initializer “Authentify precompile hook”, :group => :all do |app| app.config.assets.precompile += [ ‘authentify/application.css.scss’, ‘authentify/layout.css.scss’, ‘authentify/login.css.scss’, ‘authentify/paginate.css.scss’, […]

我可以在Rails中使用prawn的pdf生成中使用highcharts吗?

在我的rails应用程序中,我使用highcharts来显示一些图表。 而现在,我需要生成带图表的pdf(我将使用虾)。 我想知道我是否可以在pdf中使用highcharts。 也许与ExecJS? 或者替代虾? 谢谢!

ExecJS :: ProgramError:意外的令牌:名称(选项)

我的应用在本地环境中运行良好。 我试图git push构建git push送到heroku。 我的命令是: bundle install git add . git commit -am “abcdef” git push heroku master 然后我遇到了资产问题:预编译 remote: —–> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: I, [2016-01-04T08:32:35.471098 #1018] INFO — : Writing /tmp/build_5d68c6d2f7845ca719a5f77705a12798/public/assets/recruiters-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js remote: I, [2016-01-04T08:32:35.471825 #1018] INFO — : Writing /tmp/build_5d68c6d2f7845ca719a5f77705a12798/public/assets/recruiters-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js.gz remote: I, [2016-01-04T08:32:35.477826 #1018] INFO — […]

“无法找到JavaScript运行时”。 我该如何安装?

我无法启动rails服务器。 显然我没有JavaScript运行时。 $ rails s c:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require’: There was an error while trying to load the gem ‘uglifier’. (Bundler::GemRequireError) Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. 我去了链接 https://github.com/rails/execjs 但我无法弄清楚该怎么做。 那么我怎样才能’安装’JavaScript运行时? 这里还有我的GemFile: source ‘https://rubygems.org’ git_source(:github) do |repo_name| repo_name = […]

ExecJS咖啡脚本没有显示编译错误的行号(Rails资产管道)

在我的一个Rails应用程序中,ExecJS没有显示coffeescript编译错误的行号。 我的编译错误消息将如下所示: ExecJS::RuntimeError in Referrals#new Showing ~/MyApp/app/views/layouts/application.html.erb where line #6 raised: SyntaxError: unexpected IDENTIFIER (in ~/MyApp/assets/javascripts/utils.js.coffee) 请注意,咖啡脚本源没有行号(第6行用于erb文件)。 在我的另一个应用程序中,我仍然在获取行号,语法错误如下所示: ExecJS::ProgramError in Projects#show Showing ~/OtherApp/app/views/layouts/application.html.erb where line #17 raised: Error: Parse error on line 6: Unexpected ‘STRING’ (in ~/OtherApp/app/assets/javascripts/projects.js.coffee) 所以似乎区别在于ExecJS::ProgramError会给我行号,而ExecJS::RuntimeError则不行。 任何人都知道如何获得行号? 为什么我的应用程序在咖啡资产编译上创建RuntimeErrors,而另一个是给出ProgramErrors? 我检查过Rails,它们似乎匹配。 请注意,如果我修复编译错误,应用程序运行正常(例如,咖啡文件实际上已经编译) – 但是让这些行号指向编译错误是很好的! 编辑我意识到,无论是ExecJS Runtimeerror还是ProgramError似乎并不重要 – 在第一个应用程序中,从来没有给Runtimeerror号,而在第二个应用程序中,始终存在。

Rails 5 Heroku部署错误:ExecJS :: ProgramError:SyntaxError:意外的令牌:name(autoRegisterNamespace)

当尝试将rails 5应用程序部署到heroku时,我遇到以下错误,当它到达Running: rake assets:precompile : remote: ExecJS::ProgramError: SyntaxError: Unexpected token: name (autoRegisterNamespace) (line: 14767, col: 7, pos: 457487) remote: Error remote: at new JS_Parse_Error (:3623:11948) remote: at js_error (:3623:12167) remote: at croak (:3623:21858) remote: at token_error (:3623:21995) remote: at unexpected (:3623:22083) remote: at semicolon (:3623:22601) remote: at simple_statement (:3623:25779) remote: at :3623:23567 remote: at :3623:22774 […]

TypeError:Object不支持此属性或方法

我已创建rails应用程序,我在其中创建了一个数据库(空)。 当我尝试查看我的产品页面时,我在http:// localhost:3000 / products页面上收到以下错误。 在迁移数据库之前,应用程序确实起作用。 我正在使用therubyracer,我在Windows 7上。 ExecJS::ProgramError in Products#index Showing C:/RailsInstaller/DevKit/home/JP/nameofapp/app/views/layouts/application.html.erb where line #16 raised: TypeError: Object doesn’t support this property or method (in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee) Extracted source (around line #16): 13 14 15 true %> 16 true %> 17 18 19 Rails.root: C:/RailsInstaller/DevKit/home/JP/nameofapp 这是我在Rails服务器上得到的: Started GET “/products” for 127.0.0.1 at 2015-04-23 22:28:06 -0400 […]