ActionView — Template — Error
ActionView::Template::Error (Multiple files with the same output path cannot be linked (“application.css”)
A couple of days ago, I was contacted by a recruiter about a position for web developer. This lead to the first round of an interview for the job position on the phone. We went over the usual questions like, where’d you go to school, what did you learn, what projects have you done, etc. The interview lasted about 15–20mins.
Towards the end of the interview, the recruiter asked me what projects I’m proud of. I mentioned Noodles-Oodles. Noodles-Oodles is a fun Ruby-on-Rails blog post web-app for lovers of noodles who can sign-up and create posts and reviews for noodles. It uses the Ruby on Rails framework to include reasonable validations for the simple attributes and standard user authentication which also allows logins such as Facebook, Twitter, Foursquare, GitHub. The use of nested resources with RESTful URLs are employed to view predictable URLs. ActiveRecord Query methods are used, rather than native ruby methods to perform queries on the database.
After the phone interview ended, I figured I’d review the Noodles-Oodles app, just to make sure everything was in it’s place and maybe, update some CSS.
When I opened up the project directory folder in VS Code, I saw a lot of “conflicting file…”, like THOUSANDS of them!!! I think what happened is, I had moved the app, probably not properly, from one location in a cloud-based app to another in a cloud-based app, and it created conflicting files from the last time it was saved, or whatever. Ughs.
I started the app by typing in “rails s” in the terminal of the project folder but the app didn’t start because of all the conflicting files. I wish I could remember the error that popped up, but it was clear the error was because of the conflicting files. I stopped the app by pressing contrl c in the terminal of the project folder but the app.
I made a copy of the project folder just in case I deleted something I wasn’t supposed to. And then I opened up the app in VS Code again and started deleting the conflicting files from the original project folder. After a few mins, I realized that even though I deleted all the conflicting files from the usual folders, there were thousands more in in temp, storage, public, node_modules, etc. Like thousands more…ughs!
This was gonna take forever if I continued with this method. Instead, I opened up finder and navigated to the project folder. I pressed command f and it opened up the search feature. I chose the current folder location instead of “This Mac” and I typed in “conflicting file”. This displayed all of the thousands of conflicting files. I selected all of them by pressing command a and then I pressed command delete. This deleted all of the files.
Back in VS Code, I started the app by typing in “rails s” in the terminal of the project folder. This time I got another error.
ActionView::Template::Error (Multiple files with the same output path cannot be linked (“application.css”)
I had no idea what this meant, so I did what you do when you don’t know what something means, I googled it
I opened up chrome and pasted the error in the search bar and pressed enter.
I went through a several of sites of advice, some had a lot of info but really didn’t help my situation. None of them resolved the issue I was having.
I finally got to a stackoverflow topic, How to resolve Sprockets::DoubleLinkError.
Reading through the topic, it really didn’t seem like it had anything in it that could help me, just like the other sites.
Then I got to the third comment,
“For me, this simply occurred because I had two style sheets where I should have had only one. In my case, I had
myapp/app/assets/stylesheets.application.css
AND
myapp/app/assets/stylesheets.application.css.scss
where I should have had just one of those
I removed application.css and the problem went away.”
I saw that I too had these files of application.css and application.css.scss. I thought, let me give this a try. I moved the app/assets/stylesheets.application.css file out of the project folder to the desktop, just in case this didn’t work.
Back in VS Code, I started the app by typing in “rails s” in the terminal of the project folder.
And IT WORKED!!
Woohoo!!
I’m not sure how or why but it worked and if this happens to happen in the future, I know what to do, hopefully so do you-person reading this.