Questions tagged [execjs]

ExecJS lets you run JavaScript code from Ruby. It automatically picks the best runtime available to evaluate your JavaScript program, then returns the result to you as a Ruby object.

98 questions
6
votes
2 answers

Can't precompile production assets when using ES6

I have some code using template strings which works in development, but the push to Heroku fails with this error: ExecJS::RuntimeError: SyntaxError: Unexpected character '`' Running bundle exec rake assets:precompile RAILS_ENV=production shows the…
max pleaner
  • 26,189
  • 9
  • 66
  • 118
6
votes
0 answers

[Rails 3.2.8 & ExecJS 1.4.0]Getting syntax errors, but how can I debug

For example I have the following code: function f(p) { for(var i=0;i<1;i++) { p=unescape(p); } return p; } var c='something'; When I past it in the firebug console it returns undefined. That's fine by now When I try to run it with…
user971938
  • 81
  • 2
5
votes
2 answers

Evaluating module.exports in Ruby (Rails)

Currently I'm looking to try to get something in a Hash format in Ruby from JS. I have a JS module that looks something like this module.exports = { key1: "val", key2: { key3: "val3" } ... } This is given to me as just one string. I'm…
Somnium
  • 363
  • 1
  • 8
  • 17
5
votes
8 answers

TypeError: Object doesn't support this property or method

I have created rails application where I created a database (empty). When I try to view my products page, I receive the following error on my http://localhost:3000/products page. Before migrating the database, the application did function. I am…
user4808012
  • 61
  • 1
  • 1
  • 2
5
votes
4 answers

ExecJS::RuntimeUnavailable in Rails 4.1.4

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…
AlphonseJr
  • 51
  • 1
  • 1
  • 3
4
votes
2 answers

Why do I have to add execjs and therubyracer to my gemfile for rails3.1 to work?

I don't like being in situations where I don't understand why something is working. I feel like I am using a trash bag and a rubber-band to fix a leaky pipe. Since upgrading to rails3.1 I have not been able to get it to work unless I add 'execjs'…
Spencer Cooley
  • 8,471
  • 16
  • 48
  • 63
4
votes
1 answer

ExecJS problem compiling Rails 3.1 assets

My Rails 3.1.rc4 app was working fine, but I'm trying to figure out the appropriate way to store my js files in the pipeline. If I put any code in a file other than application.js, I get the following error: Started GET "/assets/application.js" for…
Micah Alcorn
  • 2,363
  • 2
  • 22
  • 45
4
votes
1 answer

ExecJS failing with CoffeeScript not defined

This has been killing me all day. I have a Rails app that I'm upgrading from 3.2 to 4.0.13 that works fine in development. In testing in Rails 4, I get ExecJS::ProgramError: ReferenceError: CoffeScript is not defined on a whole slew of integration…
wmjbyatt
  • 686
  • 5
  • 15
4
votes
0 answers

ExecJS runtime error when trying to precompile assets for production in RoR

I've recently tried to precompile the assets of my Rails 4.2.6 CMS app, but I get this error: ** Invoke assets:precompile (first_time) ** Invoke assets:environment (first_time) ** Execute assets:environment ** Invoke environment (first_time) **…
Allanon
  • 547
  • 4
  • 24
4
votes
4 answers

Unable to push to Heroku after being able to do do

I am unable to push to Heroku. When I attempt to I get an ExecJS::ProgramError: of some kind or another. I have had multiple people check my code and no one can seem to figure it out. It appears that I have something saved wrong possibly. When I do…
Brad
  • 63
  • 6
4
votes
3 answers

ExecJS::RuntimeUnavailable error when I start the Rails server

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:…
Bathakarai
  • 1,517
  • 6
  • 23
  • 39
4
votes
1 answer

ExecJS - Javascript object instances in Ruby?

If I have a javascript object, I would normally interact with the object and its methods like this: var obj = someObject.getInstance(); var result = obj.someMethod(); where someMethod is defined like this: someObject.prototype.someOtherMethod =…
hgcrpd
  • 1,820
  • 3
  • 19
  • 32
3
votes
1 answer

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

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!
Mathieu Mahé
  • 2,647
  • 3
  • 35
  • 50
3
votes
2 answers

Getting Rails working with a JS runtime environment

I'm using Ubuntu 11.10 and the terminal to install and run Rails. Here is the process I've taken so far to setup Rails: download and install Ruby 1.9.2 and Rails 3.1.0 -- I did this using sudo apt-get ruby1.9.1 and sudo gem install rails I made a…
Nathan
  • 1,762
  • 1
  • 20
  • 30
3
votes
3 answers

ExecJS::ProgramError: SyntaxError: Unexpected token: name

I've created a JavaScript class (named as BarChart) that have constructor and several methods init. I executed below command to pre-compile assets for production environment but got error. Command used to pre-compiling assets: rake assets:precompile…
Radix
  • 2,527
  • 1
  • 19
  • 43