I just noticed that you are using a Windows PC. In this case therubyracer
will not work.

Take a look at  https://github.com/sstephenson/execjs and google for execjs
and windows.


On Sun, Sep 18, 2011 at 10:34 AM, Datawizz <chud...@gmail.com> wrote:

> Hello Martin,
> I got the following error stacktrace after including therubyracer gem:
>
>
> C:\Sites\myapp>bundle install
> Fetching source index for http://rubygems.org/
> Using rake (0.9.2)
> Using multi_json (1.0.3)
> . . . . . . . .. .  .
> . . . . . . . .. . . .
> . . . .. . . . . . . . .
>
> Using sqlite3 (1.3.4)
> Installing therubyracer (0.9.4) with native extensions C:/
> RailsInstaller/Ruby1.9
> .2/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in
> block in bui
> ld_extensions': ERROR: Failed to build gem native extension.
> (Gem::Installer::Ex
> tensionBuildError)
>
>        C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
> checking for main() in -lpthread... no
> creating Makefile
>
> make
> C:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_v8'"  >
> v8-i386-m
> ingw32.def
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o rr.o -c rr.cpp
> rr.cpp: In function 'VALUE rr_define_finalizer(VALUE, void*, VALUE)':
> rr.cpp:48:1: warning: no return statement in function returning non-
> void
> In file included from rr.cpp:3:0:
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::V
> alue, VALUE = long unsigned int]':
> rr.cpp:159:37:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8.o -c v8.cpp
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_array.o -c v8_array.cpp
> In file included from v8_array.cpp:1:0:
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::A
> rray, VALUE = long unsigned int]':
> v8_array.cpp:13:36:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_callbacks.o -c v8_callbacks.cpp
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_context.o -c v8_context.cpp
> In file included from v8_context.cpp:2:0:
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::C
> ontext, VALUE = long unsigned int]':
> v8_context.cpp:15:39:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::O
> bjectTemplate, VALUE = long unsigned int]':
> v8_context.cpp:22:143:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::V
> alue, VALUE = long unsigned int]':
> v8_context.cpp:23:110:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_date.o -c v8_date.cpp
> In file included from v8_date.cpp:4:0:
> v8_handle.h: In function 'v8::Persistent<T>& rr_v8_handle(VALUE) [with
> T = v8::D
> ate, VALUE = long unsigned int]':
> v8_date.cpp:21:52:   instantiated from here
> v8_handle.h:43:71: warning: dereferencing type-punned pointer will
> break strict-
> aliasing rules
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_debug.o -c v8_debug.cpp
> g++.exe: unrecognized option '-rdynamic'
> g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> libv8-3.3.10.2/li
> b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/
> i386-mingw32
>  -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/
> RailsInstal
> ler/Ruby1.9.2/include/ruby-1.9.1 -I.   -Wall -g -rdynamic -O3 -g -
> Wextra -Wno-un
> used-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
> missing-fie
> ld-initializers -Wno-long-long   -o v8_exception.o -c v8_exception.cpp
> v8_exception.cpp:4:22: fatal error: execinfo.h: No such file or
> directory
> compilation terminated.
> g++.exe: unrecognized option '-rdynamic'
> make: *** [v8_exception.o] Error 1
>
>
> Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/
> ruby/gems/1.9
> .1/gems/therubyracer-0.9.4 for inspection.
> Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> therubyra
> cer-0.9.4/ext/v8/gem_make.out
>        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/
> rubygems/insta
> ller.rb:511:in `block in build_extensions'
>        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> bundler-1.0.18
> /bin/bundle:13:in `<top (required)>'
>        from C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:in `load'
>        from C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:in `<main>'
>
>
>
> On Sep 18, 2:06 am, Martin Wawrusch <mar...@wawrusch.com> wrote:
> > You need to have a Javascript runtime installed. Either install node.js
> > directly or include therubyracer gem. This has been discussed on this
> list
> > multiple times.
> >
> >
> >
> > On Sat, Sep 17, 2011 at 5:55 PM, Datawizz <chud...@gmail.com> wrote:
> > > Hello ALL,
> > > I'm new to RoR, I get the following error stack whenever I issue
> > > "rails server" or "rails generate ..." command.
> >
> > > Thanks in advance!
> >
> > > ERROR STACK:
> >
> > > C:\Sites\demo_app>rails generate scaffold User name:string
> > > email:string
> > > C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/execjs-1.2.6/lib/
> > > execjs/run
> > > times.rb:46:in `autodetect': Could not find a JavaScript runtime. See
> > >https://gi
> > > thub.com/sstephenson/execjs for a list of available runtimes.
> > > (ExecJS::RuntimeUn
> > > available)
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > execjs-1.2.6/l
> > > ib/execjs.rb:5:in `<module:ExecJS>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > execjs-1.2.6/l
> > > ib/execjs.rb:4:in `<top (required)>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-script-
> > > 2.2.0/lib/coffee_script.rb:1:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-script-
> > > 2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-script-
> > > 2.2.0/lib/coffee-script.rb:1:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-script-
> > > 2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-rails-3
> > > .1.1/lib/coffee-rails.rb:1:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > coffee-rails-3
> > > .1.1/lib/coffee-rails.rb:1:in `<top (required)>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:68:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:68:in `block (2 levels) in require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:66:in `each'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:66:in `block in require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:55:in `each'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler/runtime.rb:55:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > bundler-1.0.18
> > > /lib/bundler.rb:120:in `require'
> > >        from C:/Sites/demo_app/config/application.rb:7:in `<top
> > > (required)>'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > railties-3.1.0
> > > /lib/rails/commands.rb:21:in `require'
> > >        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/
> > > railties-3.1.0
> > > /lib/rails/commands.rb:21:in `<top (required)>'
> > >        from script/rails:6:in `require'
> > >        from script/rails:6:in `<main>'
> >
> > > C:\Sites\demo_app>
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Ruby on Rails: Talk" group.
> > > To post to this group, send email to rubyonrails-talk@googlegroups.com
> .
> > > To unsubscribe from this group, send email to
> > > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/rubyonrails-talk?hl=en.- Hide quoted
> text -
> >
> > - Show quoted text -
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to