Problem In Rails Server Command

Hello Everyone
I have install rails in my laptop. I am using Ubuntu Operating System.
I create an app using $ rails new abc
and then go to the abc folder and type rails server then i got error:

[email protected]:~/abc$ rails s
/home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/execjs/
runtimes.rb:50:in autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/ execjs.rb:5:inmodule:ExecJS
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/
execjs.rb:4:in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/ lib/coffee_script.rb:1:inrequire’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/
lib/coffee_script.rb:1:in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/ lib/coffee-script.rb:1:inrequire’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/
lib/coffee-script.rb:1:in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.2/ lib/coffee-rails.rb:1:inrequire’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.2.2/
lib/coffee-rails.rb:1:in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/ bundler/runtime.rb:68:inrequire’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/
bundler/runtime.rb:68:in block (2 levels) in require' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/ bundler/runtime.rb:66:ineach’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/
bundler/runtime.rb:66:in block in require' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/ bundler/runtime.rb:55:ineach’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/
bundler/runtime.rb:55:in require' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/ bundler.rb:122:inrequire’
from /home/anurag/abc/config/application.rb:7:in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/ rails/commands.rb:53:inrequire’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/
rails/commands.rb:53:in block in <top (required)>' from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/ rails/commands.rb:50:intap’
from /home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/
rails/commands.rb:50:in <top (required)>' from script/rails:6:inrequire’
from script/rails:6:in `’

On 1 March 2012 15:44, Anurag S. [email protected] wrote:

Hello Everyone
I have install rails in my laptop. I am using Ubuntu Operating System.
I create an app using $ rails new abc
and then go to the abc folder and type rails server then i got error:


[email protected]:~/abc$ rails s
/home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/execjs/
runtimes.rb:50:in `autodetect’: Could not find a JavaScript runtime.
See https://github.com/sstephenson/execjs for a list of available
runtimes. (ExecJS::RuntimeUnavailable)

Add to Gemfile
gem ‘execjs’
gem ‘therubyracer’
and then bundle install.

Colin

Is there permanent solution for that. You are saying that i have to
add each time these gem in my each new rails app.

On 1 March 2012 16:00, Anurag S. [email protected] wrote:

Is there permanent solution for that. You are saying that i have to
add each time these gem in my each new rails app.

That is a permanent solution. Hardly a big deal compared to the
amount of work required to develop the app itself. If you google a
bit you will find the background. I believe they are not put there by
default as there are other options, if you were using jRuby for
example I believe it would be different.

Colin

/home/anurag/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.3.0/lib/execjs/


You received this message because you are subscribed to the Google G. “Ruby
on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


gplus.to/clanlaw

Thank You Colin

On Thu, Mar 1, 2012 at 5:00 PM, Anurag S. [email protected]
wrote:

Is there permanent solution for that. You are saying that i have to
add each time these gem in my each new rails app.

You will have to do something yes.

In the newer versions of Rails (4.0.0.beta) the

rubyracer

line is already there, but commented out.

What I do, is to take this order:

$ rails new name_of_app --skip-bundle
$ vim Gemfile # add “gem ‘therubyracer’”
$ bundle install

so I don’t have to wait 2 times for bundle install.

Actually, to not have to type --skip-bundle every time, I have this
.railsrc defaults file:

~$ cat ~/.railsrc
–skip-bundle
-T
-d postgresql

HTH,

Peter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs