Je suis nouveau sur Ruby on Rails et j’essayais de l’apprendre en utilisant les vidéos sur youtube et j’ai installé Heroku, Postgre SQL, Git Bash et essayé d’exécuter le serveur Rails et d’obtenir l’erreur suivante.
Pouvez-vous m’aider à ce sujet? Il y avait un problème similaire posté ici, j’ai essayé d’utiliser la résolution fournie ici, mais cela n’a pas fonctionné.
Essayé de dégager le # gem 'therubyracer', platforms: :ruby
qui n’a pas fonctionné
Les gens ont mentionné que nous devions installer Nodejs bien que je dispose de nodejs dans mon système. Je ne l’utilise pas si je l’installe même si je ne vais pas l’utiliser?
S’il vous plaît, aidez-moi à ce sujet.
$ rails s
c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb: 85: en 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 for a list of available runtimes. Backtrace for gem load error is: c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58: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 for a list of available runtimes. Backtrace for gem load error is: c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58: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 for a list of available runtimes. Backtrace for gem load error is: c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in
autodetect ‘c: / RailsInstaller / Ruby2.3.3 / lib / ruby / gems / 2.3.0 / gems / execjs-2.7.0 / lib / execjs.rb: 5: dans ' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in
‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/uglifier-4.1 .10 / lib / uglifier.rb: 5: in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/uglifier-4.1.10/lib/uglifier.rb:5:in
‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb: 82: in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:82:in
block (2 levels) in require ‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/ gems / 2.3.0 / gems / bundler-1.15.3 / lib / bundler / runtime.rb: 77: dans each' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:in
block in require ‘c: /RailsInstaller/Ruby2.3.3/li b / ruby / gems / 2.3.0 / gems / bundler-1.15.3 / lib / bundler / runtime.rb: 66: dans each' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:in
require ‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/ bundler.rb: 108: in require' c:/Sites/myrubyblog/config/application.rb:7:in
‘ c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1 .6 / lib / rails / commands / server / server_command.rb: 133: in require' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in
block in perform ‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server /server_command.rb:130:in tap' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in
perform ‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb: 27: en run' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
run' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
invoke_command ‘c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb: 387: dans dispatch' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in
perform’ c: / RailsInstaller / Ruby2.3.3 / lib / ruby / gems / 2.3.0 / gems / railsties-5.1.6 / lib / rails / command.rb: 44: in invoke' c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in
‘bin / rails: in require' bin/rails:4:in
‘ require' bin/rails:4:in
‘ Bundler Error Backtrace: from c: / RailsInstaller /Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:81:in block (2 levels) in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:77:in
chaque ‘à partir de c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3 .0 / gems / bundler-1.15.3 / lib / bundler / runtime.rb: 77: in block in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/runtime.rb:66:in
chaque ‘à partir de c: / Rail sInstaller / Ruby2.3.3 / lib / ruby / gems / 2.3.0 / gems / bundler-1.15.3 / lib / bundler / runtime.rb: 66: in require' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler.rb:108:in
require ‘de c: /Sites/myrubyblog/config/application.rb: 7: dans ' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in
require de c: / RailsInstaller /Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in block in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in
tap ‘de c: /RailsInstaller/Ruby2.3.3/lib/ruby /gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in
run ‘à partir de c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0 / lib / thor / invocation .rb: 126: in invoke_command' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in
dispatch’ de c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in perform' from c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:in
invoke ‘de c: /RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0 /gems/railties-5.1.6/lib/rails/commands.rb:16:in ' from bin/rails:4:in
require’ de bin / rails: 4: in `’
L’erreur est “Impossible de trouver un runtime Javascript” car vous utilisez Uglifier.
Uglifier est un wrapper JS et nécessite un runtime JS en cours d’exécution.
NodeJS est ma recommandation.
L’installation de NodeJS devrait résoudre votre problème.
Vous pouvez l’installer en utilisant le programme d’installation ici: https://nodejs.org/en/download/
Ou utilisez sudo apt-get install NodeJS
ou équivalent, selon votre système, sur la ligne de commande