I can not run my first Ruby on Rails application on Ubuntu

I followed the steps of installing Ruby on Rails according to the guide that provides the same page of Ruby on Rails and when executing the command to wake up the server does not work and this error message comes out:

augusto@augusto-VirtualBox:~$ cd miprimer
augusto@augusto-VirtualBox:~/miprimer$ rails server
/usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:84:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) Gem Load Error is: Could not find a JavaScript runtime. See [https://github.com/rails/execjs](https://github.com/rails/execjs) for a list of available runtimes. Backtrace for gem load error is: /home/augusto/.rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in autodetect’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs.rb:5:in \<module:ExecJS\>' /home/augusto/.rvm/gems/ruby-2.4.1/gems/execjs-2.7.0/lib/execjs.rb:4:in <main>’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:21:in block in require_with_bootsnap_lfi’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:20:in require_with_bootsnap_lfi’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in block in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in load\_dependency' /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/uglifier-4.1.10/lib/uglifier.rb:5:in \<main\>' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:71:in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:71:in block in require\_with\_bootsnap\_lfi' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/loaded\_features\_index.rb:65:in register’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:70:in require\_with\_bootsnap\_lfi' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:79:in require’
/usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in block (2 levels) in require' /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler/runtime.rb:76:in each’
/usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in block in require' /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler/runtime.rb:65:in each’
/usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in require' /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler.rb:114:in require’
/home/augusto/miprimer/config/application.rb:7:in \<main\>' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:21:in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require\_with\_bootsnap\_lfi' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/loaded\_features\_index.rb:65:in register’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require\_with\_bootsnap\_lfi' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:29:in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in block in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:249:in load_dependency’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server\_command.rb:145:in block in perform’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in tap' /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server\_command.rb:142:in perform’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in run' /home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in dispatch' /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/command/base.rb:65:in perform’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/command.rb:46:in invoke' /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands.rb:18:in <main>’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:21:in block in require_with_bootsnap_lfi’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register' /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:20:in require_with_bootsnap_lfi’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in block in require’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in load\_dependency' /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in require’
/home/augusto/miprimer/bin/rails:9:in \<top (required)\>' /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client.rb:30:in run' /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/bin/spring:49:in <top (required)>’
/home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load' /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <top (required)>’
/usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:70:in require' /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/rubygems/core\_ext/kernel\_require.rb:70:in require’
/home/augusto/miprimer/bin/spring:15:in \<top (required)\>' bin/rails:3:in load’
bin/rails:3:in \<main\>' Bundler Error Backtrace: &nbsp;&nbsp; &nbsp;from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler/runtime.rb:80:in block (2 levels) in require’
    from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in each' &nbsp;&nbsp; &nbsp;from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler/runtime.rb:76:in block in require’
    from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in each' &nbsp;&nbsp; &nbsp;from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/bundler/runtime.rb:65:in require’
    from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in require' &nbsp;&nbsp; &nbsp;from /home/augusto/miprimer/config/application.rb:7:in <main>’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:21:in block in require_with_bootsnap_lfi’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:20:in require_with_bootsnap_lfi’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in block in require’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in load\_dependency' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:283:in require’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:145:in block in perform' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server\_command.rb:142:in tap’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in perform' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/command.rb:27:in run’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke\_command' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor.rb:387:in dispatch’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/command/base.rb:65:in perform' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/command.rb:46:in invoke’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/railties-5.2.0/lib/rails/commands.rb:18:in \<main\>' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:21:in require’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require\_with\_bootsnap\_lfi' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/loaded\_features\_index.rb:65:in register’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require\_with\_bootsnap\_lfi' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.0/lib/bootsnap/load\_path\_cache/core\_ext/kernel\_require.rb:29:in require’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in block in require' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active\_support/dependencies.rb:249:in load_dependency’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in require' &nbsp;&nbsp; &nbsp;from /home/augusto/miprimer/bin/rails:9:in <top (required)>’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client.rb:30:in run’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/bin/spring:49:in \<top (required)\>' &nbsp;&nbsp; &nbsp;from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load’
    from /home/augusto/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in \<top (required)\>' &nbsp;&nbsp; &nbsp;from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/rubygems/core\_ext/kernel\_require.rb:70:in require’
    from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:70:in require' &nbsp;&nbsp; &nbsp;from /home/augusto/miprimer/bin/spring:15:in <top (required)>’
    from bin/rails:3:in load' &nbsp;&nbsp; &nbsp;from bin/rails:3:in <main>’

I can not get the http: // localhost: 3000 and you’ll see: "Yay! You’re on Rails! "

Hi @auguschef,

In your Gemfile, do you have the following line?

gem 'therubyracer', :platforms => :ruby

If you do and it’s commented, then uncomment this line and save the file. If you don’t, please add the line and save your file. Once you do that, run bundle install.

Please let me know if that works for you. Thanks! 

1 Like

Thanks that-pat. I made the installation of this gem that you suggested, but the same message comes out.

Hi @auguschef,

Do you have NodeJS installed on your system? If not, you may need to install it too.

Thanks!

1 Like

You are right. Now run. Thank you very much.

@that-pat wrote:

Hi @auguschef,

 

In your Gemfile, do you have the following line?

 

gem ‘therubyracer’,:platforms =>:ruby

 

If you do and it’s commented, then uncomment this line and save the file. If you don’t, please add the line and save your file. Once you do that, run bundle install.

 

Please let me know if that works for you. Thanks! 

Resolveu aqui, muito obrigado

Hello @slackpro 

I’d like to start by saying thank you so much for participating!

We take our Code of Conduct very seriously and want to help ensure that everyone has a good experience free of antagonism and harassment. Unfortunately, we don’t currently have moderators for languages other than English. What this means is that, until that changes, we need to ask that everyone use English here in the GitHub Community Forum when posting.

Thanks for meeting us halfway!

Greatly appreciated,

-MChevy422