camdixon
camdixon

Reputation: 892

How to get Ruby on Rails running, and start a server

I'm running Ruby on rails, and am almost there! I go to execute the command

rails server

And it complains about Javascript runtime issues. Below is just one example.

/home/cameron/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/execjs-1.4.0/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 /home/cameron/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'

So I went to this website like it said

https://github.com/sstephenson/execjs

How do you actually install one of these such as node.js to get the server to work? Thanks so much for your help! I'm looking forward to getting started with Ruby on Rails

Upvotes: 0

Views: 235

Answers (1)

Marek Lipka
Marek Lipka

Reputation: 51171

Add

gem 'therubyracer'

to your Gemfile. Then run

bundle

The error occurs because you don't have JavaScript runtime environment, which is needed by Asset Pipeline.

Upvotes: 2

Related Questions