1

I tried to follow the suggestion on Why does dropdown-toggle (bootstrap) not work on heroku?

heroku run rake assets:precompile

It is still not working and now I can't push my app. Here's the build log:

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
###### WARNING:
   Removing `Gemfile.lock` because it was generated on Windows.
   Bundler will do a full resolve so native gems are handled properly.
   This may result in unexpected gem versions being used in your app.
   In rare occasions Bundler may not be able to resolve your dependencies at all.
   https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using 1.6.3
   Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
   Fetching gem metadata from https://rubygems.org/...........
   Resolving dependencies...
   Using rake 10.4.0
   Using json 1.8.1
   Using minitest 5.4.3
   Using builder 3.2.2
   Using i18n 0.6.11
   Using erubis 2.7.0
   Using thread_safe 0.3.4
   Using rack 1.5.2
   Using mime-types 1.25.1
   Using polyglot 0.3.5
   Using arel 5.0.1.20140414130214
   Using bundler 1.6.3
   Using coffee-script-source 1.8.0
   Using execjs 2.2.2
   Using thor 0.19.1
   Using hike 1.2.3
   Using multi_json 1.10.1
   Using pg 0.17.1
   Using tilt 1.4.1
   Using rails_serve_static_assets 0.0.2
   Using rails_stdout_logging 0.0.3
   Using sass 3.2.19
   Using rdoc 4.1.2
   Using tzinfo 1.2.2
   Using treetop 1.4.15
   Using rack-test 0.6.2
   Using coffee-script 2.3.0
   Using sprockets 2.12.3
   Using uglifier 2.5.3
   Using rails_12factor 0.0.3
   Using sdoc 0.4.1
   Using activesupport 4.1.4
   Using tzinfo-data 1.2014.10
   Using mail 2.5.4
   Using actionview 4.1.4
   Using activemodel 4.1.4
   Using jbuilder 2.2.5
   Using activerecord 4.1.4
   Using actionpack 4.1.4
   Using actionmailer 4.1.4
   Using railties 4.1.4
   Using coffee-rails 4.0.1
   Using jquery-rails 3.1.2
   Installing sprockets-rails 2.2.2
   Using rails 4.1.4
   Using sass-rails 4.0.5
   Your bundle is complete!
   Gems in the groups development and test were not installed.
   It was installed into ./vendor/bundle
   Bundle completed (10.20s)
   Cleaning up the bundler cache.
   Removing sprockets-rails (2.2.1)
-----> Preparing app for Rails asset pipeline
   Running: rake assets:precompile
   I, [2014-12-02T02:18:29.591951 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/glyphicons-halflings-regular-6572f83b3f4a158d107325ec2b878cbe.eot
   I, [2014-12-02T02:18:29.594241 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/glyphicons-halflings-regular-5b9db2babc068b0779bc5e895ed4386d.svg
   I, [2014-12-02T02:18:29.596441 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/glyphicons-halflings-regular-a53fcfd09adcad8b6ad046a244a815f0.ttf
   I, [2014-12-02T02:18:29.598201 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/glyphicons-halflings-regular-917c2421bd334517fcd2892224654b37.woff
   I, [2014-12-02T02:18:29.601476 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/3dDoge-414b0885d06d68d5cd7c2c126176e357.gif
   I, [2014-12-02T02:18:39.653432 #726]  INFO -- : Writing /tmp/build_98b743445a7a66fe8626ac85bbd79632/public/assets/application-9d647aa1b7daef52524576ac3d3ae9db.js
   rake aborted!
   Sass::SyntaxError: Invalid CSS after "...":3,"sources":[": expected "|", was ""less/theme.les..."
   (in /tmp/build_98b743445a7a66fe8626ac85bbd79632/app/assets/stylesheets/application.css)
   (sass):472
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1147:in `expected'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1085:in `expected'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1080:in `tok!'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:785:in `attrib_name!'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:753:in `attrib'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:672:in `simple_selector_sequence'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:646:in `_selector'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:619:in `selector'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:603:in `selector_sequence'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:528:in `ruleset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:591:in `block in declaration_or_ruleset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1123:in `call'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1123:in `rethrow'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:592:in `declaration_or_ruleset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:554:in `block_child'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:543:in `block_contents'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:535:in `block'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:529:in `ruleset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:553:in `block_child'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:546:in `block_contents'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:82:in `stylesheet'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:27:in `parse'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:342:in `_to_tree'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:315:in `_render'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:262:in `render'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/sass_compressor.rb:24:in `evaluate'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
   /tmp/build_98b743445a7a66fe8626ac85bbd79632/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
   Tasks: TOP => assets:precompile
   (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app

I am new at this and I am not sure what I messed up now. Please help!

I have also checked my stylesheet and I can't find the error that was in my build log:

*= require_tree .
*= require_self
*/
#map {
width: 100%;
height: 500px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 4px;
}

body {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
background-image: url(https://www.moj.io/wp-content/uploads/mojio_spiderweb_bkg.jpg);
padding: 10px;
}

h1 {
color: #666;
font-size: 2.1em;
font-weight: 800;
margin-bottom: 20px;
padding-left: 65px;
text-transform: uppercase;
background-image: url(https://www.moj.io/wp-content/uploads/2013/09/mojioappicon.png);
background-position: center left;
background-repeat: no-repeat;
background-size: 50px;
height: 50px;
text-shadow: 0px 2px 4px #FFF;
}

result {
padding-bottom: 15px;
color: #FF8800;
font-weight: 500;
font-style: italic;
text-align: center;
}

footer {
background-image: url(https://www.moj.io/wp-content/uploads/Mojio_Logo_400x400.png);
background-position: center center;
background-repeat: no-repeat;
background-size: 50px;
height: 50px;
padding: 10px;
background-color: #FFF;
border: 1px solid #ccc;
border-radius: 6px;
}
Siguza
  • 21,155
  • 6
  • 52
  • 89

1 Answers1

2

You have to deal with

Sass::SyntaxError: Invalid CSS after "...":3,"sources":[": expected "|", was ""less/theme.les..."

Incerteza
  • 32,326
  • 47
  • 154
  • 261
  • Which file is this error in? I didn't change any code before I got this problem though. – toiletmuffin Dec 02 '14 at 03:25
  • @toiletmuffin, it says in "theme.less". The errors like this happen pretty often. There's also a flag in production.rb, I don't remember what it's called, something like "assets", so it should be changed to the opposite value, it might also help you. – Incerteza Dec 02 '14 at 03:57
  • I looked through the folder and I couldn't find such a file. Is there a way to go back to the way things were before I tried to precompile the assets? – toiletmuffin Dec 02 '14 at 04:24
  • @toiletmuffin, I don't know how to go back on heroku, try to set the appropriate flag I mentioned about in production.rb and re-deploy to heroku. I figure you don't even have to run assets:compile. – Incerteza Dec 02 '14 at 04:44
  • 'config.assets.compile = false' I've switched that to true but I still get the same error when I try to push it to Heroku. – toiletmuffin Dec 02 '14 at 05:00
  • @toiletmuffin, since the file theme.less doesn't exist, it might the case that a gem holds it, try removing redundant gems from your gemfile if you have any . – Incerteza Dec 02 '14 at 09:08
  • I think the syntax error was in the bootstrap.css.map file. But since that was not a human-readable file, I chose to delete that file from my folder and I am able to build and push to heroku now. Even the dropdown toggle is working now(my original problem)! However, I just want to know what the file I deleted was used for and is there any future problems that I would run into if I don't include that file in my project. Thanks! – toiletmuffin Dec 02 '14 at 10:05
  • @toiletmuffin, that's the reason I try to avoid using LESS and other similar things, regarding problems - I don't know, but this might be helpful http://stackoverflow.com/questions/21504611/what-are-the-map-files-used-for-in-bootstrap-3-1 – Incerteza Dec 02 '14 at 10:25
  • `heroku rollback` will re-deploy the last version, for future reference. – elithrar Jun 30 '15 at 21:02