Note that there are some explanatory texts on larger screens.

plurals
  1. PORepair git -fd clean mistake ? Now seeing "cannot load such file -- less"
    text
    copied!<p>Without understanding, I mistakenly ran <code>git clean -fd</code> and saw this:</p> <pre><code>perrys-MacBook-Pro:pc perry_mac$ git clean -fd Removing log/ Removing public/system/ Removing tmp/ </code></pre> <p>Now, when I run <code>rails s</code> and load <code>http://localhost:3000/</code> I get:</p> <pre><code>LoadError at / cannot load such file -- less (in /Users/perry_mac/rails_projects/pc/app/assets/stylesheets/bootstrap_and_overrides.css.less) </code></pre> <p>Rails Better Errors shows that the exception happens in line 7</p> <p>app/views/layouts/application.html.erb</p> <pre><code> 2 &lt;html&gt; 3 &lt;head&gt; 4 &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; 5 &lt;title&gt;&lt;%= content_for?(:title) ? yield(:title) : "Some Cases" %&gt;&lt;/title&gt; 6 &lt;meta name="description" content="&lt;%= content_for?(:description) ? yield(:description) : "Some Radiology Cases" %&gt;"&gt; 7 &lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt; 8 &lt;%= javascript_include_tag "application" %&gt; 9 &lt;%= csrf_meta_tags %&gt; 10 &lt;%= yield(:head) %&gt; 11 &lt;/head&gt; 12 &lt;body&gt; </code></pre> <p>Having now read more on <code>git clean</code> I fear I Have made a terrible mistake. In truth, I don't understand what I may have lost. The output of </p> <pre><code>Removing log/ Removing public/system/ Removing tmp/ </code></pre> <p>... seems innocuous enough. Am I just one step away from getting my app running again or is it something worse? I understand that whatever <code>git clean -fd</code> removed is unrecoverable.</p> <p>Here is a <a href="http://pastebin.com/eMAHuZ4v" rel="nofollow">pastebin of my gemfile</a>, which I think has all the expected gems.<br> Here is a <a href="http://pastebin.com/JcWsTaFE" rel="nofollow">pastebin of my .gitignore</a> file.</p> <p>I am further confused because <code>/config/database.yml</code> is in <code>.gitignore</code>, but the file was not deleted.</p> <p>Please address your answer towards these two points:</p> <p>1) Based on the output, is there a simple way to know what files I have lost? What is now gone?<br> 2) Why has my rails app stopped working and what's a good next step to fix it?</p> <p>ADDENDUM 1:<br> I ran bundle install<br> I ran rails <code>g bootstrap:install less</code> </p> <pre><code>perrys-MacBook-Pro:pc perry_mac$ rails g bootstrap:install less SECURITY WARNING: No secret option provided to Rack::Session::Cookie. This poses a security threat. It is strongly recommended that you provide a secret to prevent exploits that may be possible from crafted cookies. This will not be supported in future versions of Rack, and future versions will even invalidate your existing user cookies. Called from: /Users/perry_mac/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. insert app/assets/javascripts/application.js create app/assets/stylesheets/application.css identical app/assets/javascripts/bootstrap.js.coffee conflict app/assets/stylesheets/bootstrap_and_overrides.css.less Overwrite /Users/perry_mac/rails_projects/pc/app/assets/stylesheets/bootstrap_and_overrides.css.less? (enter "h" for help) [Ynaqdh] Y force app/assets/stylesheets/bootstrap_and_overrides.css.less create config/locales/en.bootstrap.yml gsub app/assets/stylesheets/application.css gsub app/assets/stylesheets/application.css </code></pre> <p>Now I see this error:</p> <pre><code>/Users/perry_mac/rails_projects/pc/app/assets/stylesheets/application.css.scss has already been required </code></pre> <p>I think this may be because: </p> <pre><code>app/assetts/stylesheets/application.css app/assetts/stylesheets/application.css.scss </code></pre> <p>both contain:</p> <pre><code> *= require_self *= require_tree . </code></pre> <p>Can you suggest the best way to resolve this cyclical require?</p> <p>If I delete the contents of <code>app/assetts/stylesheets/application.css</code> and save the empty file, my application loads and runs, but there is no styling applied.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload