ExecJS::RuntimeError in Home#index

I have just installed RoR using RailsInstaller.

This is on a Windows XP system.

I have created the default application and it loads via localhost

I have also updated execjs to 1.2.9 and installed nodes as initially there was no javascript support. ( not sure why the windows script server did not work though)

I am now working through the Getting Started with Rails, Blog application at Getting Started with Rails — Ruby on Rails Guides

I receive the following error when I try to access the application:

ExecJS::RuntimeError in Home#index

Showing C:/Sites/blog/app/views/layouts/application.html.erb where line #6 raised:

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

  (in C:/Sites/blog/app/assets/javascripts/home.js.coffee)

Extracted source (around line #6):

3: <head> 4: <title>Blog</title> 5: <%= stylesheet_link_tag "application" %> 6: <%= javascript_include_tag "application" %> 7: <%= csrf_meta_tags %> 8: </head> 9: <body>

The files application.js and home.js.coffee have no code, they are just the original templates.

The line " 'C:\Program' is not recognized as an internal or external command, operable program or batch file." suggest that the space in a path name is causing a problem.

Any help or guidance would be welcomed.

Reinstall node into a directory without spaces.

As for no JScript support, does invoking cscript.exe from the command line works?

Reinstall node into a directory without spaces.

As for no JScript support, does invoking cscript.exe from the command line works?

-- Luis Lavena

Luis

good evening

cscript.exe does run from the command line from the application directory

I have run this: C:\Sites\blog>gem install node Successfully installed node-0.0.2 1 gem installed Installing ri documentation for node-0.0.2... Installing RDoc documentation for node-0.0.2...

can you tell what programme or file is being looked for from line #6 <%= javascript_include_tag "application" %>

Ted

Any further help on this.

It is very frustrating as the error message is not pointing at a solution. Does any one know what is causing the error?

What actually happens from this line?

<%= javascript_include_tag "application" %>

Thanks

Ted Finch wrote in post #1034656:

Reinstall node into a directory without spaces.

As for no JScript support, does invoking cscript.exe from the command line

works?

OK folks

I may have resolved this. There is information on installing node.js here:

http://cedricdussud.com/2011/11/installing-node-js-on-windows/

"Install Node

The simplest way is to download the Windows installer from the Node site. Since they update quickly I won’t bother to put a direct link — it’s every easy to find from the home page. Two things to keep in mind:

    Be SURE to get a verision of Node >= 0.6.3.     Use the .msi to install. Otherwise you won’t get npm

The installer simply copies Node.exe to a folder inside the Program Files directory and updates your Path environment variable to point to it.

If you want to put Node elsewhere you can move the folder from Program Files, drop it where you like, and update the Path environment variable.

Setting the Path variable is important, so here’s how to do it manually: go to System Properties in the Control Panel, Advanced, and hit the Environment Variables button. Scroll down under ‘System variables’ to Path. Hit edit, and add your directory (say C:\bin \node) to it. Be sure to separate it from the previous entry with a semicolon."

The windows MSI installs to a directory below c:\Program Files and it seems to be the space in the file path that causes the problem. I have moved the nodejs directory to the root and updated the PATH variable accordingly.

Good night

This is crime.

For this to actually work on Windows (with RailsInstaller) I had to first install node with official msi installer. Then I copied node.exe to folder without whitespaces in its path (than added this path to PATH variable of course) and then I also needed to uninstall node from control panel / uninstall so that rails picked new path.

This is crime.

Dunno why are you having this level of issues. On a fresh installation of Windows and RailsInstaller I was able to use execjs with the Windows Scripting Host by default without issues.

There was no need to install node, at all.

For this to actually work on Windows (with RailsInstaller) I had to first install node with official msi installer. Then I copied node.exe to folder without whitespaces in its path (than added this path to PATH variable of course) and then I also needed to uninstall node from control panel / uninstall so that rails picked new path.

Perhaps because you tried to do that in a open command prompt? Changes to the PATH are not applied to existing sessions, that is true for bash too.

I faced the same error message when I following

I installed the node from this website and restarted the windows PC. Now everything is working fine. I can see the hello Rails message.