Skip to content

Instantly share code, notes, and snippets.

@dbwest
Created May 28, 2012 16:36
Show Gist options
  • Save dbwest/2820027 to your computer and use it in GitHub Desktop.
Save dbwest/2820027 to your computer and use it in GitHub Desktop.
haml rails error after 'rake erb:to:haml'
!!!
%html
%head
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
%title Shirt off my back
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
%body{"data-offset" => "50", "data-spy" => "scroll", "data-target" => ".subnav"}
.navbar.navbar-fixed-top
.navbar-inner
.container
%a.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse"}
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.brand{:href => "#"} Shirts
.nav-collapse
%ul.nav
%li.active
%a{:href => "#"} Daily Threads
%li
%a{:href => "#"} Daily Shred
%li
%a{:href => "#"} Link
%li
%a{:href => "#"} Link
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
Dropdown
%b.caret
%ul.dropdown-menu
%li
%a{:href => "#"} Action
%li
%a{:href => "#"} Another action
%li
%a{:href => "#"} Something else here
%li.divider
%li
%a{:href => "#"} Separated link
%form.navbar-search.pull-left
%input.search-query.span2{:placeholder => "Search", :type => "text"}
%ul.nav.pull-right
%li.divider-vertical
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
Dropdown
%b.caret
%ul.dropdown-menu
%li
%a{:href => "#"} Action
%li
%a{:href => "#"} Another action
%li
%a{:href => "#"} Something else here
%li.divider
%li
%a{:href => "#"} Separated link
.container
%header#overview.jumbotron.subhead.well
%h1 Store:
%p.lead Buy my shirts.
.row
.span4
- if @cart
= hidden_div_if(@cart.line_items.empty?, id: 'cart') do
= render @cart
- if session[:user_id]
%ul
%li= link_to 'Orders', orders_path
%li= link_to 'Products', products_path
%li= link_to 'Users', users_path
= button_to 'Logout', logout_path, method: :delete
.span8
= yield
why:mydepot dev$ bundle install
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.5)
Using activesupport (3.2.3)
Using builder (3.0.0)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.3)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.3)
Using mime-types (1.18)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Using bcrypt-ruby (3.0.1)
Using bootstrap-sass (2.0.0)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.3)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.3)
Using coffee-rails (3.2.2)
Using haml (3.1.6)
Using haml-rails (0.3.4)
Using hpricot (0.8.6)
Using multi_xml (0.5.1)
Using httparty (0.8.3)
Using jquery-rails (2.0.2)
Using jquery-ui-themes (0.0.5)
Using pg (0.13.2)
Using bundler (1.1.3)
Using rails (3.2.3)
Using sexp_processor (3.2.0)
Using ruby_parser (2.3.1)
Using sass (3.1.18)
Using sass-rails (3.2.5)
Using uglifier (1.2.4)
Using will_paginate (3.0.3)
SyntaxError in Admin#index
Showing /Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml where line #68 raised:
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:68: syntax error, unexpected ')'
));}\n #{_hamlout.for...
^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:71: syntax error, unexpected $undefined
...lout.push_text(" <ul>\n <li>#{_hamlout.a...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:72: syntax error, unexpected ')'
));}</li>\n <li>#{_...
^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:73: unknown regexp option - l
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:73: syntax error, unexpected $undefined
));}</li>\n <li>#{_hamlout.a...
^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:74: syntax error, unexpected ')'
));}</li>\n </ul>\n ...
^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:74: unknown regexp option - l
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:74: syntax error, unexpected $undefined
));}</li>\n </ul>\n #{_hamlout.adjust_...
^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:76: syntax error, unexpected keyword_class, expecting keyword_do or '{' or '('
...push_text(" <div class='span8'>\n #{_ham...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:76: syntax error, unexpected $undefined
..." <div class='span8'>\n #{_hamlout.adjus...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: unknown regexp options - dv
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: syntax error, unexpected $undefined
... </div>\n </div>\n </div>\n </div>\n ...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: unknown regexp options - dv
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: syntax error, unexpected $undefined
...div>\n </div>\n </div>\n </body>\n</html>\n", -6, f...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: unknown regexp options - htl
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: syntax error, unexpected $undefined
... </div>\n </body>\n</html>\n", -6, false);::Haml::Util.h...
... ^
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: unterminated string meets end of file
/Users/dev/rails_projects/mydepot/app/views/layouts/application.html.haml:77: syntax error, unexpected $end, expecting keyword_end
Extracted source (around line #68):
65: .span4
66: - if @cart
67: = hidden_div_if(@cart.line_items.empty?, id: 'cart') do
68: = render @cart
69: - if session[:user_id]
70: %ul
71: %li= link_to 'Orders', orders_path
Trace of template inclusion: app/views/layouts/application.html.haml
Rails.root: /Users/dev/rails_projects/mydepot
Application Trace | Framework Trace | Full Trace
Request
Parameters:
None
Show session dump
Show env dump
Response
Headers:
None
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'bcrypt-ruby'
# gem 'disguise'
gem 'bootstrap-sass', '2.0.0'
gem 'haml-rails'
# for html2haml
gem 'hpricot'
gem 'ruby_parser'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'jquery-ui-themes'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
gem 'will_paginate', '~> 3.0'
namespace :erb do
namespace :to do
desc "converts .html.erb files to html.haml"
task :haml do
files = `find . -iname *.html.erb`
files.each_line do |file|
file.strip!
print "parsing file: #{file}\n"
`bundle exec html2haml #{file} | cat > #{file.gsub(/\.erb$/, ".haml")}`
`rm #{file}`
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment