Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

ExecJS::RuntimeError in Statuses#index

I'm on a Windows 8 PC. I get this error in the middle of the Ruby "Generate Rails Application" when I type statuses after localhost:3000.

Has anyone else experienced this?

In my case deleting the //=require_tree did not solve my problem and i also tried other suggestions and no luck. After a couple of minutes i found that by deleting the <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> in /app/view/layouts/application.htlm.erb it solved my problem.

7 Answers

Got it! Open up treebook\assets\javascripts\application.js

Delete //=require_tree at the bottom of the document.

Thanks a lot - fixed my problem. :)

FIxed! Thanks

Removing //=require_tree caused other issues to occur. This is what worked for me:

http://stackoverflow.com/questions/13530042/execjsruntimeerror-in-usersindex-ror

Hannah McFarlane
Hannah McFarlane
2,810 Points

This worked perfectly for me, too.

Timothy Chan
Timothy Chan
3,715 Points

This did not work for me. Still running into problems.

Other thread I'm looking at which also did not work by installing nodejs: http://teamtreehouse.com/forum/ruby-status-issue

Jay Killeen
PLUS
Jay Killeen
Courses Plus Student 3,725 Points

I just went through this same problem.

I used the solution found on this page of StackExchange

http://stackoverflow.com/questions/13530042/execjsruntimeerror-in-usersindex-ror

The only difference to my solution was I had to modify the runtimes.rb file found under the execjs-2.0.2 directory. In the comments of StackExchange someone tries to correct it and say it should be runtime.rb. That lead me down a path that didn't solve the problem. But the original answer leads you to

"C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\execjs-1.4.0\lib\execjs\ru??ntimes.rb"

when it should be

"C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\execjs-2.0.2\lib\execjs\ru??ntimes.rb"

Oliver Gibbs
Oliver Gibbs
9,771 Points

Thanks for that, the //=require_tree solution above worked for me. For those that are ahead/finished in the Rails course from this question, how are you finding it using Windows? I'm on Windows 8 and as the lessons are done on a Mac I wondered if these problems are going to keep happening. This four minute video has taken me 20 minutes to get through and I'm wondering if I should just start borrowing my wifes Macbook for this. Thoughts?

Olatunde Alegbe
Olatunde Alegbe
1,177 Points

No very little about coding. Playing around with Rails. This is how you solve it. If I can anyone can ;-)!

https://github.com/sstephenson/execjs/issues/81#issuecomment-9892952