Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Execjs and its JS runtime environment #4020

Closed
jfeaver opened this issue Dec 18, 2011 · 6 comments
Closed

Problem with Execjs and its JS runtime environment #4020

jfeaver opened this issue Dec 18, 2011 · 6 comments

Comments

@jfeaver
Copy link

jfeaver commented Dec 18, 2011

I'm using Ubuntu 11.10 and package managers in 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 new rails app using rails new path/to/app
  • I went to the new app directory and tried running rails server and got an error about not having a JS ruby environment
  • I had to get a JS runtime environment for execjs so I downloaded 'therubyracer' as well as 'therubyrhino' and added them to my gem file, one at a time like this: gem 'therubyracer' then ran bundle install
  • After everything was successful with the install, I ran rails server again
    -- with both runtime environments I have had similar errors:

Could not find libv8-3.3.10.4 in any of the sources
Run bundle install to install missing gems.

Could not find therubyrhino-1.73.0 in any of the sources
Run bundle install to install missing gems.

Bundle knows where these programs live, giving correct pathnames when I enter bundle show libv8 or bundle show therubyrhino. They are both in /usr/lib/ruby/gems/1.9.1/gems/_ where all the other gems are located for the bundle install.

Is this an issue with my machine or is there some step that I've forgotten?

Thanks so much,
Feav

@guilleiguaran
Copy link
Member

Try removing therubyrhino from Gemfile, use only therubyracer and run bundle install again.

@jfeaver
Copy link
Author

jfeaver commented Dec 19, 2011

I am being misunderstood. I have tried using both therubyrhino as well as therubyracer individually but get the same error both times.

@guilleiguaran
Copy link
Member

can you try install the gems inside of your app?

bundle install --path vendor/bundle

Try only with therubyracer.

@ghost
Copy link

ghost commented Dec 27, 2011

I suggest installing Node.JS (using this for instance). This solved the problem for me because Node.JS uses a JS runtime that seems to be recognized by default by ExecJS.

@brentsowers1
Copy link

You shouldn't have to install node.js. You can simply add therubyracer to your Gemfile. I've made a fix to the rails script to automatically put the line for therubyracer to the Gemfile:
For Rails 3.1 - #4407
For Rails 3.2 - #4406
For Rails master - #4405

@vijaydev
Copy link
Member

vijaydev commented Feb 9, 2012

Closing. New apps are generated with a commented line in the gemfile now.

@vijaydev vijaydev closed this as completed Feb 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants