I had the same problem and I fixed it by installing nodejs
on my system independent of the gem.
on ubuntu its: sudo apt-get install nodejs
I'm using 64bit ubuntu 11.10
update: From @Galina 's answer below I'm guessing that the latest version of nodejs is required, so @steve98177 your best option on a redhat(or CentOS) box is to install from source code as @Galina did, but as you can't "make/install" on this box ?, I suggest you try to install a fedora rpm(long shot) https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager or find another RH/CentOs box(that you can 'make' on) and create your own rpm and install on original RH box(if old glibc on RH plays nice).
The real issue here(IMHO) is installing Gems that have dependencies on installed packages outside of the ruby environment, is there a way of knowing before installing ? an RFI for Gems or bundler ?
sudo yum install nodejs
In your gemfile add:
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
For more details: ExecJS and could not find a JavaScript runtime
This is the link I needed to fix the problem (install nodejs): https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
When you create an empty project, this line is commented in Gemfile. Just uncomment it and bundle!
gem 'therubyracer', :platforms => :ruby
I had similar issues on ubuntu 12.04. Installing Node.js fixed it.
If you were on ubuntu
$ sudo apt-get install nodejs
Try to don't use another systems like Windows to development. Think that almost all servers in the world are Linux servers, so when you try to deploy that application it will be easier if you have developed that on a Linux or Unix environment too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With