execjs

Node.js not found by Rails / execjs

北城以北 提交于 2019-12-17 16:38:06
问题 I have node.js installed by compiling and installing it from the root user. I think this maybe where the hangup is. From the user running the rails app I checked for node.js. $ which node /usr/local/bin/node When I launched my rails app (Rails 3.2.9) I get the universally unhelpful "We're sorry, but something went wrong." Checking the the production error log I saw that the Javascript runtime was not found. That's confusing as it is obviously installed. So I went about forcing the Node

Calling Node.js script from Rails app using ExecJS

≡放荡痞女 提交于 2019-12-14 00:15:01
问题 I have a Rails application that needs to run a node script. I imagine that using the ExecJS gem is the cleanest way to run JavaScript from a Rails app. However, so far, ExecJS has proved to be very frustrating to use. Here is the script I need to run: // Generated by CoffeeScript 1.7.1 (function() { var PDFDocument, doc, fs; fs = require("fs"); PDFDocument = require('pdfkit'); doc = new PDFDocument; doc.pipe(fs.createWriteStream('output.pdf')); doc.addPage().fontSize(25).text('Here is some

ExecJS::RuntimeError in rails 3.2.8 engine with javascript_include_tag

帅比萌擦擦* 提交于 2019-12-13 02:43:20
问题 We are putting two rails 3.2.8 engines together in one rails app. The problem is that ExecJS does not like namespace for javascript_inclide_tag in layouts file. Here is the tag which causing the error: <%= javascript_include_tag 'authentify/application' %> Here authentify is rails engine name. The error is: 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

Can I use highcharts in a pdf generate with prawn in Rails?

有些话、适合烂在心里 提交于 2019-12-10 17:43:06
问题 In my rails application, I use highcharts to display some charts. And now, I need to generate a pdf with charts (I will use prawn). I want to know if I can use highcharts in my pdf. Maybe with ExecJS ? Or with an alternative to prawn ? Thanks! 回答1: You can use wkhtmltopdf (http://code.google.com/p/wkhtmltopdf/) to render the javascript charts as a PDF This blog post is helpful: http://www.claytonlz.com/index.php/2011/02/broken-highcharts-wkhtmltopdf/ 来源: https://stackoverflow.com/questions

“Could not find a JavaScript runtime”. How do I install one?

廉价感情. 提交于 2019-12-10 11:34:20
问题 I am unable to start a rails server. Apparently I don't have a JavaScript runtime. $ 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. I went to the link https://github.com/rails/execjs But I couldn't

ExecJS::RuntimeUnavailable in Rails 4.1.4

痞子三分冷 提交于 2019-12-10 06:21:24
问题 UPDATE : Things are now working ! Thanks to deep, I installed node.js then got a TZInfo::DataSourceNotFound error wich got resolved by adding gem 'tzinfo-data', platforms: [:mingw, :mswin] and bundle update . Thank you sir ! First of all, I am a complete beginner on rails (just so that you get how beginner I am : I feel as being an expert for just posting here) and this is my first question here so please excuse me if I'm not very clear. So, I am a windows 7 user, learning rails with the One

ExecJS::RuntimeUnavailable error when I start the Rails server

大兔子大兔子 提交于 2019-12-07 10:22:14
问题 I have created a new Rails application. When I try to start the server I get the following error: [bathakarai@Project1-CO samp]$ rails server /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr in PATH, mode 040777 /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr in PATH, mode 040777 /home/bathakarai/.rvm/gems/ruby-2.0.0-p0

ExecJS::RuntimeUnavailable error when I start the Rails server

送分小仙女□ 提交于 2019-12-05 17:49:56
I have created a new Rails application. When I try to start the server I get the following error: [bathakarai@Project1-CO samp]$ rails server /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr in PATH, mode 040777 /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.4/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr in PATH, mode 040777 /home/bathakarai/.rvm/gems/ruby-2.0.0-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See

ExecJS::RuntimeUnavailable in Rails 4.1.4

时光怂恿深爱的人放手 提交于 2019-12-05 15:36:17
UPDATE : Things are now working ! Thanks to deep , I installed node.js then got a TZInfo::DataSourceNotFound error wich got resolved by adding gem 'tzinfo-data', platforms: [:mingw, :mswin] and bundle update . Thank you sir ! First of all, I am a complete beginner on rails (just so that you get how beginner I am : I feel as being an expert for just posting here) and this is my first question here so please excuse me if I'm not very clear. So, I am a windows 7 user, learning rails with the One Month course and I encounter an error while trying to : $ rake routes rake aborted! ExecJS:

ExecJS coffee script not showing line numbers for compile errors (Rails asset pipeline)

血红的双手。 提交于 2019-12-03 13:23:23
问题 In one of my Rails apps, ExecJS is not showing line numbers for coffeescript compilation errors. My compile error message will look like this: 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) Note that there's no line number for the coffee script source (line #6 is for the erb file). On another one of my apps, where I'm still getting the line