【发布时间】:2013-05-27 17:14:56
【问题描述】:
没看懂,误跑git clean -fd看到了这个:
perrys-MacBook-Pro:pc perry_mac$ git clean -fd
Removing log/
Removing public/system/
Removing tmp/
现在,当我运行 rails s 并加载 http://localhost:3000/ 时,我得到:
LoadError at /
cannot load such file -- less (in /Users/perry_mac/rails_projects/pc/app/assets/stylesheets/bootstrap_and_overrides.css.less)
Rails Better Errors 显示异常发生在第 7 行
app/views/layouts/application.html.erb
2 <html>
3 <head>
4 <meta name="viewport" content="width=device-width, initial-scale=1.0">
5 <title><%= content_for?(:title) ? yield(:title) : "Some Cases" %></title>
6 <meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Some Radiology Cases" %>">
7 <%= stylesheet_link_tag "application", :media => "all" %>
8 <%= javascript_include_tag "application" %>
9 <%= csrf_meta_tags %>
10 <%= yield(:head) %>
11 </head>
12 <body>
现在在git clean 上阅读了更多信息,我担心我犯了一个严重的错误。事实上,我不明白我可能失去了什么。
Removing log/
Removing public/system/
Removing tmp/
... 似乎无伤大雅。我离让我的应用程序再次运行仅一步之遥还是更糟?我知道无论git clean -fd 被删除是无法恢复的。
这是pastebin of my gemfile,我认为它拥有所有预期的宝石。
这是一个pastebin of my .gitignore 文件。
我更加困惑,因为/config/database.yml 在.gitignore 中,但文件没有被删除。
请针对这两点回答您的问题:
1) 根据输出,有没有一种简单的方法可以知道我丢失了哪些文件?现在怎么了?
2) 为什么我的 rails 应用程序停止工作,下一步该如何解决?
附录 1:
我跑了捆绑安装
我跑了 rails g bootstrap:install less
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
现在我看到了这个错误:
/Users/perry_mac/rails_projects/pc/app/assets/stylesheets/application.css.scss has already been required
我认为这可能是因为:
app/assetts/stylesheets/application.css
app/assetts/stylesheets/application.css.scss
都包含:
*= require_self
*= require_tree .
您能否提出解决这种周期性需求的最佳方法?
如果我删除 app/assetts/stylesheets/application.css 的内容并保存空文件,我的应用程序会加载并运行,但没有应用任何样式。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 git twitter-bootstrap less