Tag Archives: rails

Ror deployed to heroku has application error and code = H10 desc = “app crashed” problems

1. Preparation before problem discovery
When I was reading Learn Python In Hard Way, I saw that there is a wonderful thing the author talks about. There is a boring thing she does before doing something funny, called Yak shaving. Things like setup, configuration and so on before you learn a language or technology.

I heard a fellow student say that if you do the Web, you can learn ROR. I looked it up and found Ruby on Rails as its author —

David Heinemeier Hansson is also a rather amazing programmer. Then I wanted to learn Ruby systematically this time, but I found a lot of details, so I wanted to change another way of learning and directly learn ROR.

About this kind of study way, I searched some experience to answer again. One senior summed it up very well. Three books later.

1. HeadFirst HTML AND CSS

2. The Linux Command Line

3. Pro Git

From the basic front end, Linux as a whole and basic shell, as well as Git tools. Skip the first according to individual knowledge, pick the knowledge point that does not understand to read, the latter two read more carefully. I found myself using Git, not knowing that snapshot is the same thing, and how the control flow of Git is different from SVN. For the first time, I found that double-click in Linux can be copied, and middle mouse button can be pasted directly.

2. Identify problems

I’ll watch Ruby on Rails Tutorial later, and the first chapter is Yak Shaving.

Configure the ROR environment yourself, and then formally deploy to Heroku. And then there’s the problem. Application Error and code=H10 desc=”App Chinese “problem.

Heroku itself can see the error by clicking View Logs

at=error code=H10 desc="App crashed" method=GET path=/ host=xxx.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes=

3. Problem solving
This doesn’t tell you what the problem is. Keep checking. http://stackoverflow.com/questions/13496827/heroku-deployment-error-h10-app-crashed

As in the first answer, type Heroku Run Rails Console. You can fix the trouble.

2016-02-29T05:18:58.740439+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in `<top (required)>': uninitialized constant Sass::Script (NameError)
2016-02-29T05:18:58.740461+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `require'
2016-02-29T05:18:58.740463+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `<top (required)>'
2016-02-29T05:18:58.740463+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `require'
2016-02-29T05:18:58.740464+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `<top (required)>'
2016-02-29T05:18:58.740465+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
2016-02-29T05:18:58.740466+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
2016-02-29T05:18:58.740466+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
2016-02-29T05:18:58.740469+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
2016-02-29T05:18:58.740470+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
2016-02-29T05:18:58.740470+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
2016-02-29T05:18:58.740471+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
2016-02-29T05:18:58.740472+00:00 app[web.1]:    from /app/config/application.rb:7:in `<top (required)>'
2016-02-29T05:18:58.740473+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
2016-02-29T05:18:58.740473+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
2016-02-29T05:18:58.740474+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
2016-02-29T05:18:58.740475+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
2016-02-29T05:18:58.740475+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2016-02-29T05:18:58.740476+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
2016-02-29T05:18:58.740477+00:00 app[web.1]:    from bin/rails:9:in `require'
2016-02-29T05:18:58.740477+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2016-02-29T05:18:59.458586+00:00 heroku[web.1]: State changed from starting to crashed
2016-02-29T05:18:59.444429+00:00 heroku[web.1]: Process exited with status 1

according to

/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in `<top (required)>': uninitialized constant Sass::Script (NameError)

You can guess that it’s the version of SASS-Rails in the gem file. I suddenly remembered this detail.

In fact, according to the third edition of the book’s Gemfile configuration, the book configuration is gem ‘sass-Rails ‘,’5.0.0.beta1’, this step when executing the bundle install will report an error. I’m just going to get rid of beta1.

Because of this error, I changed it to version 5.0.1. But it’s still wrong. I had no idea last week. After you reorganize your thoughts today, check this mistake again.

Found the answer: http://stackoverflow.com/questions/29594420/rails-tutorial-error-with-cloud-9

It should be configured as gem ‘sass-Rails ‘,’5.0.2’.

Successful official deployment of Hello World.

Recently I watched The Secret of Music, a behind-the-scenes work on a song, and as a programmer I should be able to see the same respect for my profession.

Recently, it seems that he suddenly has a soft rib, and suddenly he has armor. Become more determined.

comparison of Fixnum with nil failed

  def validate
    errors.add(:score, '您的积分不够') if (!self.cur_ask_score.nil?) && (self.score > self.cur_ask_score)
  end

, that’s the validation in the model.

, I started with

  def validate
    errors.add(:score, '您的积分不够') if self.score > self.cur_ask_score
  end

results in the following error:

comparison of Fixnum with nil failed

just now, I ran into a weird problem — the usual assumption is that saving a successful operation doesn’t work!

this kind of problem, generally is the model validation failure caused by!