Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Dylan Merritt
Dylan Merritt
15,682 Points

New to Rails, and not able to start the server.

I am trying to start my Rails server, and each time it tells me that it could not find a Javascript runtime. Does anyone have any suggestions?

3 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, I would suggest downloading cmder (http://bliker.github.io/cmder/) and using it instead of the Windows terminal, you should also complete the Console Foundations course: http://teamtreehouse.com/library/console-foundations-2

This will help you a LOT in the long run. You should also consider installing some Linux distribution (like Ubuntu) on a virtual machine (VMWare Player), because Rails development under Windows is often very painful.

As for your current error, try installing NodeJS (http://nodejs.org/), this might fix it.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

What operating system are you on and what is the full error message?

Dylan Merritt
Dylan Merritt
15,682 Points

I am running Windows 7. This is the full output when I try to start the server:

C:\Sites\treebook2>rails server
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/lib/execjs/run
times.rb:51: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.3/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/l
ib/execjs.rb:5:in `<module:ExecJS>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.2.1/l
ib/execjs.rb:4:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.5.3
/lib/uglifier.rb:3:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.5.3
/lib/uglifier.rb:3:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:76:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:72:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:72:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:61:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler/runtime.rb:61:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/
lib/bundler.rb:132:in `require'
        from C:/Sites/treebook2/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:79:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:79:in `block in server'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:76:in `tap'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:76:in `server'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

I've never used the command line before and I'm kind of struggling. Hopefully I've got it all set up right and am just overlooking something.

Dylan Merritt
Dylan Merritt
15,682 Points

I'm also not entirely sure that I'm accessing my application 'treebook2' properly. When I open Rails, I enter "cd treebook2". Is that wrong? How am I supposed to access that application?