title: undefined method `empty?' for nil:NilClass in application.less
body: <p>I've just been assigned to a <code>rails 3.2.13</code> project and something with my local environment does not like the app at all even though it works fine on other people's computers. I'm also brand new to the app, so not very familiar with the structure, which makes it more frustrating. The current issue is that whenever I launch the server and go to local host, I get </p>
  
  <pre><code>undefined method `empty?' for nil:NilClass
    (in /Users/app/assets/stylesheets/application.less)
  </code></pre>
  
  <p>The error says there is a problem in the _head partial that refers to application.less</p>
  
  <pre><code>&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"&gt;
    &lt;title&gt;&lt;%= content_for?(:title) ? yield(:title) : "Travel" %&gt;&lt;/title&gt;
    &lt;meta name="description" content="&lt;%= content_for?(:description) ? yield(:description) : "Travel" %&gt;"&gt;
    &lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt;
    &lt;%= stylesheet_link_tag "dashboard", :media =&gt; "all" %&gt;
    &lt;%= stylesheet_link_tag "common", :media =&gt; "all" %&gt;
    &lt;%= stylesheet_link_tag "jquery-ui-1.10.4.custom.min", :media =&gt; "all" %&gt;
    &lt;%= stylesheet_link_tag "datetimepicker", :media =&gt; "all" %&gt;
    &lt;%= javascript_include_tag "application" %&gt;
    &lt;%= javascript_include_tag "jquery-ui-1.10.4.custom.min" %&gt;
    &lt;%= csrf_meta_tags %&gt;
    &lt;%= yield(:head) %&gt;
  
    &lt;link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,300italic' rel='stylesheet' type='text/css'&gt;
  
    &lt;!--[if lt IE 9]&gt;
    &lt;script src="assets/js/html5shiv.js"&gt;&lt;/script&gt;
    &lt;link href="assets/css/ie.css" rel='stylesheet' type='text/css'&gt;
    &lt;![endif]--&gt;
  
    &lt;!--[if IE 7]&gt;
    &lt;link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css"&gt;
    &lt;![endif]--&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>and if I take the following lines out, the app renders but there is no styling which makes sense.</p>
  
  <pre><code>&lt;%= stylesheet_link_tag "application", :media =&gt; "all" %&gt;
        &lt;%= stylesheet_link_tag "dashboard", :media =&gt; "all" %&gt;
        &lt;%= stylesheet_link_tag "common", :media =&gt; "all" %&gt;
        &lt;%= stylesheet_link_tag "jquery-ui-1.10.4.custom.min", :media =&gt; "all" %&gt;
        &lt;%= stylesheet_link_tag "datetimepicker", :media =&gt; "all" %&gt;
        &lt;%= javascript_include_tag "application" %&gt;
        &lt;%= javascript_include_tag "jquery-ui-1.10.4.custom.min" %&gt;
  </code></pre>
  
  <p>And there is no empty? method in <code>application.less</code> or anything it refers to as far as I can tell. </p>
  
  <pre><code>/*
   * This is a manifest file that'll be compiled into application.css, which will include all the files
   * listed below.
   *
   * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
   * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
   *
   * You're free to add application-wide styles to this file and they'll appear at the top of the
   * compiled file, but it's generally better to create a new file per style scope.
   *
  */
  
  @import "twitter/bootstrap/bootstrap";
  @import "font-awesome";
  
  
  //Argo variables &amp; Custom style
  @import "argo/variables.less";
  @import "argo/custom-scrollbar.less";
  @import "argo/argo.less";
  @import "argo/button.less";
  
  @import "social-buttons.less";
  
  @import "responsive.less";
  @import "style.less"; // style.less should be the last to load in order to be able to overwrite default properties.
  
  // Seems this doesn't work on production !! Try inport it inside the &lt;head&gt; view.
  // @import "dashboard";
  // @import "datetimepicker.css";
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>source "https://rubygems.org"
  
  gem "rails", "3.2.13"
  gem "pg"
  
  gem "nokogiri"
  
  group :assets do
    gem "sass", "3.1.10"
    gem "sass-rails"
    gem "less-rails"  
    gem "coffee-rails", "~&gt; 3.2.1"
    gem "uglifier", "&gt;= 1.0.3"
    gem "quiet_assets"
  end
  
  gem "jquery-rails", "2.3.0"
  
  gem "docx_templater"
  
  gem 'haml', '3.1.7'
  
  gem 'geocoder'
  
  
  gem "less-rails-bootstrap", "~&gt; 2.3.2"
  gem "less-rails-fontawesome", "~&gt; 0.4.3"
  gem "therubyracer"
  
  gem "devise", "&gt;= 2.2.3"
  gem "omniauth"
  gem "omniauth-facebook", "1.4.0"
  gem "cancan", "&gt;= 1.6.9"
  gem "rolify", "&gt;= 3.2.0"
  gem "figaro", "&gt;= 0.6.3"
  
  gem "filepicker-rails"
  
  gem "activeadmin"
  gem "just-time-picker"
  gem "meta_search",    "&gt;= 1.1.0.pre"
  gem "country-select"
  
  gem "ckeditor"
  #gem "roadie"
  
  gem "momentjs-rails" # http://momentjs.com
  </code></pre>
  
  <p>Side note, I think there is possibly a larger problem, because I had to comment out some things in order just to get here. Because I use <code>rails 4.1</code> for my other apps, could something with homebrew or some local configurations be messing with things? Should I just do a fresh uninstall and reinstall of everything?</p>
  
  <p>full trace of errors</p>
  
  <pre><code>sass (3.1.10) lib/sass/tree/root_node.rb:23:in `render'
  sass (3.1.10) lib/sass/engine.rb:300:in `_render'
  sass (3.1.10) lib/sass/engine.rb:247:in `render'
  sass-rails (3.2.6) lib/sass/rails/compressor.rb:16:in `compress'
  actionpack (3.2.13) lib/sprockets/compressors.rb:74:in `compress'
  sprockets (2.2.2) lib/sprockets/processing.rb:243:in `block in css_compressor='
  sprockets (2.2.2) lib/sprockets/processor.rb:29:in `call'
  sprockets (2.2.2) lib/sprockets/processor.rb:29:in `evaluate'
  tilt (1.4.1) lib/tilt/template.rb:103:in `render'
  sprockets (2.2.2) lib/sprockets/context.rb:193:in `block in evaluate'
  sprockets (2.2.2) lib/sprockets/context.rb:190:in `each'
  sprockets (2.2.2) lib/sprockets/context.rb:190:in `evaluate'
  sprockets (2.2.2) lib/sprockets/bundled_asset.rb:26:in `initialize'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `new'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `build_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/environment.rb:78:in `find_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:177:in `[]'
  actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:126:in `asset_for'
  actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:44:in `block in stylesheet_link_tag'
  actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:43:in `collect'
  actionpack (3.2.13) lib/sprockets/helpers/rails_helper.rb:43:in `stylesheet_link_tag'
  app/views/layouts/_head.html.erb:7:in `_app_views_layouts__head_html_erb___1065452930202511865_70305601381520'
  actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.13) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.13) lib/action_view/renderer/partial_renderer.rb:265:in `render_partial'
  actionpack (3.2.13) lib/action_view/renderer/partial_renderer.rb:238:in `block in render'
  actionpack (3.2.13) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.13) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (3.2.13) lib/action_view/renderer/partial_renderer.rb:237:in `render'
  actionpack (3.2.13) lib/action_view/renderer/renderer.rb:41:in `render_partial'
  actionpack (3.2.13) lib/action_view/helpers/rendering_helper.rb:27:in `render'
  haml (3.1.7) lib/haml/helpers/action_view_mods.rb:13:in `render_with_haml'
  app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb___277714497504725548_70305601320420'
  actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.13) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
  actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.13) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.13) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.13) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.13) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.13) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.13) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.13) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.13) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.13) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /Users/MontyHackintosh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
  activesupport (3.2.13) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:39:in `render'
  actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (3.2.13) lib/action_controller/metal/responder.rb:232:in `default_render'
  actionpack (3.2.13) lib/action_controller/metal/responder.rb:160:in `to_html'
  actionpack (3.2.13) lib/action_controller/metal/responder.rb:153:in `respond'
  actionpack (3.2.13) lib/action_controller/metal/responder.rb:146:in `call'
  actionpack (3.2.13) lib/action_controller/metal/mime_responds.rb:239:in `respond_with'
  devise (3.2.4) app/controllers/devise/sessions_controller.rb:10:in `new'
  actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.13) lib/active_support/callbacks.rb:447:in `_run__4105908760234858153__process_action__1733817669043599896__callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
  actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
  omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
  omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
  sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__2732989691270559818__call__1934934084652397979__callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
  actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /Users/MontyHackintosh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
  /Users/MontyHackintosh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
  /Users/MontyHackintosh/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
  </code></pre>
  
  <p>Update: </p>
  
  <p>It has been pointed out that there could be a problem with devise and routes. Infact I had to comment out the line below <code>scope "/:locale", :constraints =&gt; {:locale =&gt; /[a-z]{2}(-[A-Z]{2})?/} do</code> in order for the server to even start. If I uncomment this line the server won't start and it reads:</p>
  
  <pre><code>`devise_omniauth_callback': Devise does not support scoping omniauth callbacks under a dynamic segment (RuntimeError)
  and you have set "/:locale/users". You can work around by passing
  `skip: :omniauth_callbacks` and manually defining the routes. Here is an example:
  
      match "/users/auth/:provider",
        constraints: { provider: /google|facebook/ },
        to: "devise/omniauth_callbacks#passthru",
        as: :omniauth_authorize,
        via: [:get, :post]
  
      match "/users/auth/:action/callback",
        constraints: { action: /google|facebook/ },
        to: "devise/omniauth_callbacks",
        as: :omniauth_callback,
        via: [:get, :post]
  </code></pre>
  
  <p>Routes.rb</p>
  
  <pre><code>scope "/:locale", :constraints =&gt; {:locale =&gt; /[a-z]{2}(-[A-Z]{2})?/} do
  
      root to: "dashboards#index"
  
      devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "users/omniauth_callbacks", :registrations =&gt; "users/registrations" }
  
      resources :dashboards
  
      resources :users do
        resources :travels do
          get 'cgv', :on =&gt; :member
        end
        resources :cars
        resources :rents do
          resource :payment
          get 'cgv', :on =&gt; :member
        end
      end
      resources :rents, only: [:new]
      match "/rents/check_discount" =&gt; "rents#check_discount", as: "check_discount"
      match "/rents/autocomplete_user" =&gt; "rents#autocomplete_user", as: "autocomplete_user"
      match "/rents/fill_driver_infos" =&gt; "rents#fill_driver_infos", as: "fill_driver_infos"
      resources :travels, only: [:new]
  
      authenticated :user do
        match "/travels", to: redirect { |p, req| "/#{p[:locale]}/users/#{req.env["warden"].user(:user).id}/travels/new" }, :as =&gt; 'travels'
      end
  
      unauthenticated :user do
        match '/travels(/:action)' =&gt; 'anonymous_travels', :as =&gt; 'travels'
      end
  
      match '/search(/:action)' =&gt; 'search', :as =&gt; 'search'
  
    end
  </code></pre>