Join GitHub today
I'm getting this error, like a lot of others:
and have already spent more hours searching google then I will admit to. I believe this is an execJs bug, but what do i know? From all the posts, this is a very common issue with rails 3.1. A js runtime is now needed by what are now standard gems like coffee-script and sass.
Most of these cases were resolved by adding the gems 'execjs' and 'therubyracer' to the app Gemfile, and then running 'bundle update' and/or 'bundle install'. But not for me.
I guess I got lucky. I am running rails 3.1.3/ruby 1.9 on an old version of Redhat Linux (Ver 4 (2.6.9-101.ELsmp)). The gcc is 3.4.6.
Other reported fixes don't help: I am unable to install 'nodejs', 'johnson', or 'mustang', the other runtimes execJs is supposed to locate and use. They won't make/install on my system.
So I need to fix the problem causing execJs to fail to locate 'therubyracer'. Has anyone been down this road? Here is the Gemfile (and bundle install says Ok):
gem 'rails', '3.1.3'
gem "therubyracer", :require => 'v8'
group :assets do
And here is a trace:
~/rails/316-private-pub/chatter-after>rake db:create --trace
There is nothing interesting in the development log.
Here is the execjs dir:
I have also tried execjs-1.2.13. Same problem, I believe.
If I comment execjs.rb below, I can run rake without the error:
But then I don't get a runtime, do I? Is execJs a runtime itself? No.
I can see where the error text comes from in runtimes.rb:
So the question is, since I do have 'therubyracer' installed, why can't runtimes.rb find it? Is execJs broken?
Here it 'therubyracer':
Anyone else had this problem with execJs?
Thanks, your help would be most helpful!
When I do this (after removing the comment-out from execjs.rb)
The code in runtime.rb,
produces an error:
So now it looks like the require is failing in ruby_racer_runtime.rb.
fails. From irb>,
but gem check 'therubyracer' is clean.
I was facing the same issue. I installed nodejs libs on my Ubuntu machine using apt-get install nodejs, it is working fine now.
Trying to build on solaris 10 - therubyracer won't build; node.js won't build. I got spidermonkey and built a static library. How can I use that within execjs?
To get my Rails-server to start on Windows (7 64bit), I- **installed NodeJS** to a directory that does **NOT** include spaces (eg. in `C:\development\nodejs\`) ... because `where` (Windows version of `which`) was not able to find executables in the PATH if the respective entry was surrounded by quotation marks - made sure that `where node` returned the node-executable (eg. `C:\development\nodejs\node.exe`) I just installed (if where can't find NodeJS, execJS will probably not find it either) if `where node` returns an error, check your PATH-variable, you may want to move the entry for NodeJS to the front and NOT use quotation marks - excluded therubyracer from the Gemfile by changing the respective line to `gem 'therubyracer', :platforms => :ruby` (as said before) this will lead to therubyracer being installed in Linux/production environment, but not on local Windows environment - deleted the Gemfile.lock and called `bundle install` in order to have a clean installation of the gemfiles - started Rails with `rails server`
For guys, still having this issue on docker with alpine. This image helped me solve the issue: https://hub.docker.com/r/usualoma/ruby-with-therubyracer/builds/bmp6m8xaohdyawebk5cvgx5/