• Register
0 votes
360 views

Problem :

I am starting a new app when I try to create a controller page home and try to go to local host:3000/pages/home, I am getting the following error:

Showing c:/Users/desktop/pinplug/app/views/layouts/application.html.erb where line #6 raised:
TypeError: Object doesn't support this property or method
(in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

 

6 5 3
7,540 points

2 Answers

0 votes

Solution :

I have lots of industry experience in writing complex Rails code.

I have gone through your post and understood your problem.

So to begin with you must follow below approach to resolve your issue:.

The only thing that solved it for me and is still rendering the JavaScript and stylesheets is to first change your application to application.css for the style sheets even if you are using Sass/SCSS, as it still compiles down into css and your application.js for the JavaScript link. Once that is done, go to your /assets/javascripts/application.js file and delete the // in front of //= require turbolinks.

And now your application should be working just fine.

This is most probably the deeper issue with turbolinks, but this is the quick workaround that has not let me down yet.

OR

For windows if coffee-script source >= 1.9.0 not work properly then just add following code in Gemfile:

gem 'coffee-script-source', '1.8.0'

and run

bundle update coffee-script-source

 And your issue will be resolved.

9 7 4
38,600 points
0 votes

Solution:

In your /app/views/layouts/application.html.erb lines 5 and 6, alter the first parameter from application to default.

I met the similar issue, too for my condition, I don't know why, however it only occurs on Windows. The parameter application performs on the web server.

In case you are running in WIndows, the coffee-script-source 1.9.0 does not employ on windows.

Alter it to a previous version including this line to your Gemfile:

gem 'coffee-script-source', '1.8.0'

And then reinstall the bundle synthesizing the dependencies for the new Gem version with:

bundle update coffee-script-source

 1 - replacing application by default

Replacing the "application" by "default" in blog\app\views\layouts\application.html.erb
From

<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

To

<%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'default', 'data-turbolinks-track': 'reload' %>

It must currently be performing fine. Although I've read that there might be an issue at the time running javascript while employing "default" instead of application.

2 - altering coffee script's version in the Gemfile

Add in blog/GemFile the coffee-script-source v1.8.0 (v1.9.0 does not work on Windows)

#For Windows it works with CofferScript v1.8
gem 'coffee-script-source', '1.8.0'

Stop the server (in case it was running) and do:

bundle update coffee-script-source

You forgot '>' at the end, so full tag looks like

<%= javascript_include_tag "application", "data-turbolinks-track" => true %>

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 75 views
75 views
Problem: I am currently learning through a Agile Web Development book with the Rails version 3.2.13 and Ruby 2.0.0, but I unfortunately I keep on receiving the below error if I try to access a localhost:3000: Sprockets::FileNotFound in Store#index couldn't find file 'jquery' ( ... '~> 2.3.0' and I also have attempted many of the different solutions which I found online but it did not work for me.
asked Jul 25 Raphael Pacheco 4.9k points
0 votes
1 answer 16 views
16 views
Problem: Marketers rely on the three types of social media:?
asked Jul 22 ArifulIslam 5.7k points
0 votes
2 answers 16 views
16 views
Problem: What type of storage media must be used to create a Windows system image?
asked Mar 9 ArifulIslam 5.7k points
0 votes
1 answer 27 views
27 views
Problem: I am little bit confused and need help regarding my query that, What Installation Media Source is the Most Common Source for Linux Packages? DVD NFS Hard disk CD-ROM
asked Feb 22 maddi86 5.4k points
0 votes
1 answer 19 views