Error when running rails app - ExecJS::RuntimeError

后端 未结 6 798
深忆病人
深忆病人 2020-11-29 11:07

I tried googling this and I haven\'t found an answer yet to my problem.

I am trying to run a simple controller script through rails and it is giving me this error wh

相关标签:
6条回答
  • 2020-11-29 11:33

    None of the above worked for me . . . I installed gem 'coffee-script-source', '1.8.0'.

    Then application started running without any problem.

    0 讨论(0)
  • 2020-11-29 11:36

    you have to install an additional gem for javascript. edit gemfile and add gem 'therubyracer'. You can then run bundle to install the new gem.

    here is your solution in detail: http://www.railszilla.com/2011/12/rails-3-coffescript-execjs/

    0 讨论(0)
  • 2020-11-29 11:38

    It looks like you might be missing a few gems.

    Add to your Gemfile:

    gem 'therubyracer'
    gem 'execjs'
    

    And then run $ bundle install to install them.

    0 讨论(0)
  • 2020-11-29 11:41

    It happened to me too! You need to install "nodejs". As I work with Ubuntu Linux I did:

    apt-get install nodejs 
    

    Source: http://forums.pragprog.com/forums/148/topics/9665#posts-26576 (Sam Ruby's post)

    0 讨论(0)
  • 2020-11-29 11:45

    If you are having this problem in production server this might be due to memory usage. while doing assets precompilation server use lot of memory.

    consider restarting your production server. 
    
    0 讨论(0)
  • 2020-11-29 11:48

    Seems like javascript runner is missing you just need to do

    gem 'therubyracer'
    

    then

     bundle install
    

    then restart the server if you are using the production server then consider restart the production server.

    It will definitely solve your problem,

    cheers

    0 讨论(0)
提交回复
热议问题