ExecJS::RuntimeError running the Getting Started with Rails blog on cygwin (windows7) -


i trying run getting started rails blog on cygwin (windows7). following error message:

execjs:: runtimeerror in welcome#index

module.js:340     throw err;           ^ error: cannot find module 'c:\tmp\execjs20130903-50672-1vn7gqc.js'     @ function.module._resolvefilename (module.js:338:15)     @ function.module._load (module.js:280:25)     @ function.module.runmain (module.js:497:10)     @ startup (node.js:119:16)     @ node.js:901:3    (in /usr/lib/ruby/gems/1.9.1/gems/turbolinks-1.3.0/lib/assets/javascripts   /turbolinks.js.coffee) 

node installed.

this after

$rails generate controller welcome index $rails s 

i running rails 4.0 on cygwin ideas why might happening?

thanks

umbregachoong

i encountered error , had path temp file being wrong. able fix changing following 2 files in \gems\[ruby version]\gems\execjs-2.0.2\lib\execjs. (possibly found in \usr\lib\ruby\, depends on how ruby installed. i'm using rvm mine different.)

external_runtime.rb

compile_to_tempfile(source) |file|      extract_result(@runtime.send(:exec_runtime, file.path))   end end 

should change to

compile_to_tempfile(source) |file|     filepath = file.path     if execjs.cygwin? && @runtime.name == "jscript"       io.popen("cygpath -m " + file.path) { |f| filepath = f.read }       filepath = filepath.gsub("\n","")     end     extract_result(@runtime.send(:exec_runtime, filepath))   end end 

module.rb

add right before last 2 ends.

def cygwin?   @cygwin ||= rbconfig::config["host_os"] =~ /cygwin/ end 

after restart rails server , luck should work.

source: https://github.com/sstephenson/execjs/issues/78


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -