0

I'm just starting out trying to learn to code and I'm trying to get Ruby running for my first time. Ive been searching for over an hour and can't find a solution. When I try to connect to the server i get this error:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in `autodetect': Could
not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS:
:RuntimeUnavailable)
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:5:in `<module:ExecJS>'

        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:4:in `<top (required)>
'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `<top (requir
ed)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `requi
re'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block
 (2 levels) in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'

        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block
 in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'

        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `requi
re'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
        from C:/Sites/railsbridge/test_app/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.
rb:79:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.
rb:79:in `block in server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.
rb:76:in `tap'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.
rb:76:in `server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.
rb:40:in `run_command!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top
(required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Then when I try to install execjs and then execjs --source http://rubygems.org the following happens:

C:\Sites\railsbridge\test_app>gem install execjs ERROR: Could not find a valid gem 'execjs' (>= 0), here is why: Unable to download data from https:// rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read serv er certificate B: certificate verify failed (https:// api.rubygems.org/latest_specs.4.8.gz)

C:\Sites\railsbridge\test_app>gem install execjs --source http:// rubygems.org Successfully installed execjs-2.2.2 Parsing documentation for execjs-2.2.2 Done installing documentation for execjs after 0 seconds WARNING: Unable to pull data from 'https:// rubygems.org/': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz) 1 gem installed

I have no idea what I'm doing wrong. I'm running on Windows 7 as well.

Update: execjs installed ok. But when i install therubyracer i get this:

C:\Sites\railsbridge\test_app>gem install therubyracer Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing therubyracer: ERROR: Failed to build gem native extension.

C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe -r ./siteconf20150127-8476-14s0h51.rb extconf.rb

creating Makefile The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/builder.rb:68:in setup_python!': li bv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/builder.rb:52:inblock in build_libv8!' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/builder.rb:49:in chdir ' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/builder.rb:49:inbuild _libv8!' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/location.rb:24:in inst all!' from extconf.rb:7:in'

extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7 for inspect ion. Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/libv8-3.16.14.7/gem_ make.out

C:\Sites\railsbridge\test_app>

ps: sorry about my format I'm trying to learn how to use it properly

  • 1
    You need the `nodejs` gem as in [this question](http://stackoverflow.com/questions/24609912/execjsruntimeunavailable-in-rails-4-1-4) – Darshan Rai Jan 27 '15 at 12:48
  • It seems you are using windows OS, So go to this link http://railsinstaller.org/en and download full bundle, it will install all the dependencies to run a rails server, although installing nodejs will solve this problem. – pkrawat1 Jan 27 '15 at 12:52
  • I originally installed ruby and rails from railsinstaller.org. I also just installed node gem, but I still get the same message. – Nathan Dalporto Jan 27 '15 at 13:38

1 Answers1

0

Try to add this in gem file

gem 'execjs'
gem 'therubyracer', :platforms => :ruby
Developer
  • 561
  • 7
  • 29