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.

On 22 March 2016 at 18:52, Aman A. [email protected] wrote:

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

Colin L. wrote in post #1182361:

On 22 March 2016 at 18:52, Aman A. [email protected] wrote:

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.

Hi,

On Wed, Mar 23, 2016, at 03:52, Aman A. wrote:

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/

On 22 March 2016 at 20:33, Aman A. [email protected] wrote:

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

On 23 March 2016 at 04:36, Aman A. [email protected] wrote:

Completed 200 OK in 21ms (Views: 18.1ms | ActiveRecord: 0.0ms)
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.

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 L. wrote in post #1182371:

On 22 March 2016 at 20:33, Aman A. [email protected] wrote:

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)

Colin L. wrote in post #1182384:

On 23 March 2016 at 04:36, Aman A. [email protected] wrote:

Completed 200 OK in 21ms (Views: 18.1ms | ActiveRecord: 0.0ms)
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.

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

Yes by install nodejs the problem got fixed. Now its running good.
Thanks for support