Search code examples
ruby-on-railsrubyruby-on-rails-3windows-8.1execjs

Ruby on Rails for Windows: how to get started without getting a different error every time?


I'm on Windows 8.1 and have been trying to get Rails to work on my computer for quite some time now. I followed the guides to install Ruby and Rails and everything correctly, but whenever I try to execute any kind of Rails command through PowerShell, I get an error with one of the gems. I can't run the server command, can't generate, can't run console. Here is the most recent error:

C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in 'autodetect': Could not find a Javascript runtime.  See https://github.com/rails/execjs for a list of available runtimes.  (ExecJS::RuntimeUnavailable)}

Other times I get errors with native gems follow guides to resolve those, but nothing ends up working.

How do I get Rails to do anything on my Windows machine? Should I just get a Linux vm?


Solution

  • I would recommend using a vm, I've used virtualbox in the past with ubuntu for rails development.

    It's not impossible to get things to work in windows, but you'll probably thank yourself later if you move to the vm. For the specific error you mention see this SO post which suggests adding therubyracer gem.