CSCRIPT.EXE doesn't work out-of-the-box on Windows 8 Consumer Preview #81
Comments
Hi, I'm on my first rail installation and unfortunately I made the mistake of using Windows 8 CP as my development machine. I would be very great-full if you could detail a bit on how to remove the //U flag to cscript.exe and change the output encoding.. What I did at this point was to follow the discussion here: https://gist.github.com/rails/rails/issues/2880 and pull this: gem 'execjs', :git => 'git://github.com/kennyj/execjs.git', :branch => 'rails_issue_2880' by modifying my Gemfile and then bundle update.. Thanks! |
Sorry it took me so long to reply...I only have the change on my home PC, and I only remembered your message while at work. :-/ The fix I made was to edit lib/execjs/runtimes.rb (under the execjs gem's path...c:\Ruby192\lib\ruby\gems\1.9.1\gems\execjs-1.3.0 on my machine) so that the JScript runtime is defined like so:
If I recall correctly, I think I removed the //U parameter from the :command string, and changed the :encoding string to read "UTF-8" rather than "UTF-16LE". |
Same problem. Worked for me. Time to move to Linux for dev. |
Same issue, same resolution works on Windows 8 RTM. Rails 3.2.6, Ruby 1.9.3, execjs 1.4.0 . Full execjs Runtimes.rb listing: https://github.com/sstephenson/execjs/blob/master/lib/execjs/runtimes.rb Working runtimes.rb :
Non-working / Default runtimes.rb :
This is the original error page I was seeing:
|
I'm seeing the same thing and I also can get everything working with this fix on Windows 8 RTM, Rails 3.2.8, and Ruby 1.9.3. I've put together a branch that encompasses this fix: jmataya/execjs@72ddd8edeb1cd9fec2ed976f1f863fde5b551b74. Feel free to use it. I also tested against Windows 7 SP1 successfully. Once I figure out why a couple test cases are failing (see jmataya/execjs#1), I'll submit a pull request to bring this back in. To use this in your project Gemfile: |
Unfortunately that branch didn't work for me, but I did correct the issue by installing nodejs(from http://nodejs.org/) and restarting windows; in case that helps anyone else until the gem is fixed/updated. |
Hi, I believe that 9 months ago when first dabbling with this I eventually made it work with jediry fix; that is using windows script host, but I then switched to linux. Today, reviewing this issue I installed nodejs and rebooted and it worked this way also. Hope this somehow helps. Too bad this isn't working out of the box yet with rails installer and execjs and with Windows Script Host. |
On Win8 RTM - workaround provided by @pottsk works for me. Thanks. |
Yep, the solution of @pottsk work for me (win8 pro 64bit - execjs 1.4.0). Thanks a lot. |
The solution provided by @pottsk worked for me. I am using a windows 8, 64 bit operating system. Thanks a lot. |
Bump still not fixed....but looks like this repo is dead, no commits for over a year. |
Hi guys I'm using Surface Pro and when I try to do the simple getting started guide from http://guides.rubyonrails.org/getting_started.html I get below error after I update config/routes.rb and try to load Hello Rails: I installed the package using railsinstaller-2.2.1 and then updated rails to version 4 using gem install. Any advise would be greatly appreciated as I haven't been able to run a simple Hello Rails since the last time I did rails in my uni 4-5 years ago :( ... thanks. |
best advice: don't use Windows for RoR On Wed, Jul 10, 2013 at 8:23 PM, jaeezzy notifications@github.com wrote:
|
installed node.js and restarted computer and it ran the Hello rails fine.. |
Works like a charm for me, thanks a mil! |
Works for me too. Windows 8 Pro. |
Rather than closing this issue, don't you think you should make the change listed above to runtimes.rb for windows 8 users? |
@pottsk's fix worked here as well. Thanks! |
http://nodejs.org/ this link worked fine for me ( Windows 8) |
And asking Windows Rails users to install node.js just to be able to write Rails apps is overkill. |
Win 7 SP1 + Ruby 2.0.0 + Rails 4.0 the workaround doesn't work for me..... try to install node.js |
Thanks to @jediry! This fix / workaround worked for me on Windows 8.1 Pro as well. C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\execjs-2.0.2\lib\execjs\runtimes.rb before:
after:
|
Change the ExecJS version to 1.2.4
|
Thanks belozi. That worked! |
Thanks Belozi, that solution worked for me , when the most poular one did not . Much obliged :) ! |
Installed execjs 1.2.4. It works now, but it does not accept unicode characters in source files. I don't know if that's on purpose (i.e. that I should not have unicode chars in js sources anyway)... but it definitely breaks compatibility with other js platforms. Converted to use escaped chars (via http://www.percederberg.net/tools/text_converter.html) and it works for now. Thanks. |
Finally got it figured out! Its a Powershell feature/bug. Anyway, as of 35c542a, it always writes the output to a tempfile which bypasses all the shell encoding stuff. |
For me, this happens on Win7 in the standard command prompt, as well as in Cmder. @belozi How to do I "go to the Gemfile"? I ran Also, how do I ensure that a given package uses this version of ExecJS? |
@KatieK2 It would be a part of your Rails app. PS- sorry I took so long to respond, I didn't realize that this was here. :) |
it doesn't work for me with version 2.4 execjs... |
doesn't work for version 2.4 execjs +1 |
+1 |
For windows users, this may work. There is a problem with coffee-script-source >1.9.0 running on windows. It seems you have to add this to your gemfile: gem 'coffee-script-source', '1.8.0' then do bundle update coffee-script-source |
Or you could do |
@rodrigoargumedo I tried all the above options, and also mixed up a few combinations of them, till I found this http://stackoverflow.com/questions/28241981/rails-4-execjsprogramerror-in-pageswelcome and had done multiple system gem updates and bundle installs and updates. I reverted all my trials and downgraded my coffee-script-source and it works. Posting here to help out anyone else, who may have a similar issue. Updating files in vendor/cache
|
@DSAMPAT I did a fresh reinstall with 2.1.6 and ExecJS works fine as it should expect to behave with a single |
@rodrigoargumedo Unless we compare bundle show we wont know for sure what other differences we may have as our apps may have other gems or dependencies that could use ExecJS as well. $ gem -v $ gem update --system $ ruby -v $ rails -v Like I said, Posting here to help out anyone else, who may have a similar issue. |
Hello, I am having the same problem. <%= link_to 'Delete', article_path(article), method: :delete, data: {confirm: 'Are you sure?'} %> so far, I just delete this line in application.html.erb so I can follow some tutorials.
could some one help me? editing jscript.rb does not solve the problem
|
Just install node.js. also see
|
@RichIsOnRails , yupp...I installed node.JS and it works! Thanks! |
UPDATE: Since Windows 10 with Rails 5.0.0 and Ruby 2.3 has not been mentioned on this thread:
|
@Bassmint123 yes, these days you basically have to install Node.js. There aren't really any easy alternatives unless you use WSL. |
Getting Rails to work on Windows 8 CP has been challenging...the biggest hurdle has been that ExecJS isn't working. I finally tracked it down to something related to the character encoding: if I remove the //U flag to cscript.exe and change the output encoding to UTF-8 in runtimes.rb, it works again. Not sure whether this is a problem with Ruby on Win8, or with cscript.exe on Win8.
The text was updated successfully, but these errors were encountered: