ExecJS::ProgramError And unable to delete the data

I have just installed ruby on rails on my window. and I was going through tutorials in Getting Started with Rails — Ruby on Rails Guides and I am getting this error (ExecJS::ProgramError in Articles#index ) So I just removed the line no 6 from /app/views/layouts/application.html.erb that is <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

And issue solved. and going further with the tutorial I came up in delete operation. http://guides.rubyonrails.org/v4.2/getting_started.html#deleting-articles

But my data is not getting deleted. It just redirect to the show page of the data which I want to delete.

Attachments: http://www.ruby-forum.com/attachment/11308/articles_controller.rb http://www.ruby-forum.com/attachment/11309/application_controller.rb http://www.ruby-forum.com/attachment/11310/application.html.erb http://www.ruby-forum.com/attachment/11311/index.html.erb

First look in log/development.log and see what is added when you click the delete link. There you should see which action is called, the parameters, and what happens next. If that all looks correct then you can insert simple debug statements into your code using code such as logger.info "some_varlable is #{some_variable.inspect}" the result will appear in development.log

However I suggest that to get started you might be better to work right through the tutorial at railstutorial.org (which is free to use online). That can be done using an IDE in the cloud9 so you are not reliant on s/w installed on your PC.

Colin

Colin Law wrote in post #1182361:

But my data is not getting deleted. It just redirect to the show page of the data which I want to delete.

First look in log/development.log and see what is added when you click the delete link. There you should see which action is called, the parameters, and what happens next. If that all looks correct then you can insert simple debug statements into your code using code such as logger.info "some_varlable is #{some_variable.inspect}" the result will appear in development.log

However I suggest that to get started you might be better to work right through the tutorial at railstutorial.org (which is free to use online). That can be done using an IDE in the cloud9 so you are not reliant on s/w installed on your PC.

Colin

I have checked my development log it show

Started GET "/articles/1" for ::1 at 2016-03-23 02:00:34 +0530 Processing by ArticlesController#show as HTML   Parameters: {"id"=>"1"}   [1m[36mArticle Load (0.0ms)[0m [1mSELECT `articles`.* FROM `articles` WHERE `articles`.`id` = 1 LIMIT 1[0m   Rendered articles/show.html.erb within layouts/application (1.0ms) Completed 200 OK in 21ms (Views: 18.1ms | ActiveRecord: 0.0ms)

It seems it rendering show controller.

Are you sure that is all that is added to the log when you click the Destroy link? I don't think that is the result of clicking the link in the index.html.erb that you posted. Are you sure there is not a bit before that? Look at it before clicking the link and record the line number of the last line. Then click it and look again.

Colin

Hi,

I have just installed ruby on rails on my window. and I was going through tutorials in Getting Started with Rails — Ruby on Rails Guides and I am getting this error (ExecJS::ProgramError in Articles#index ) So I just removed the line no 6 from /app/views/layouts/application.html.erb that is <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

And issue solved.

You didn't solve it, you removed the whole javascript, along with jquery-ujs which is required to make your delete link work.

Rails development on windows isn't really recommended for beginner as rarely anyone uses windows for it and as there's currently bug in one of the components [1], you need to work around the problem by installing nodejs [2] for now (or maybe some other workarounds). (and put the javascript back in)

[1] coffee-script-source still broken in Windows · Issue #4158 · jashkenas/coffeescript · GitHub

[2] http://nodejs.org/

Colin Law wrote in post #1182371:

logger.info "some_varlable is #{some_variable.inspect}"

Started GET "/articles/1" for ::1 at 2016-03-23 02:00:34 +0530 Processing by ArticlesController#show as HTML   Parameters: {"id"=>"1"}   [1m[36mArticle Load (0.0ms)[0m [1mSELECT `articles`.* FROM `articles` WHERE `articles`.`id` = 1 LIMIT 1[0m   Rendered articles/show.html.erb within layouts/application (1.0ms) Completed 200 OK in 21ms (Views: 18.1ms | ActiveRecord: 0.0ms)

It seems it rendering show controller.

Are you sure that is all that is added to the log when you click the Destroy link? I don't think that is the result of clicking the link in the index.html.erb that you posted. Are you sure there is not a bit before that? Look at it before clicking the link and record the line number of the last line. Then click it and look again.

Colin

Yes I am sure I have checked the line number. This is what I gets when I click on delete button in development log file.

Started GET "/articles/2" for ::1 at 2016-03-23 10:03:30 +0530 Processing by ArticlesController#show as HTML   Parameters: {"id"=>"2"}   [1m[35mArticle Load (0.0ms)[0m SELECT `articles`.* FROM `articles` WHERE `articles`.`id` = 2 LIMIT 1   Rendered articles/show.html.erb within layouts/application (0.0ms) Completed 200 OK in 62ms (Views: 45.4ms | ActiveRecord: 0.0ms)

I am confident that Nanaya has identified the problem in the previous post. In particular she(?) is correct in pointing out that rails development can be difficult under Windows. I believe that you would be best to run something like Ubuntu in a virtual machine under windows, or even better dual boot the PC so you can run either Win or Ubuntu.

Colin

Colin Law wrote in post #1182384: