Heroku Installfest


#23

The good -> That worked!! Thank you!!

The bad. I am now stuck at -> Step 4: Create a new Rails app.
I get the ‘approximate expected result’ output EXCEPT that when I click on http://localhost:3000 I get the following error instead of the Yay! You’re on Rails!

ActiveRecord::PendingMigrationError
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development
Extracted source (around line #576):
574
575
576
577
578
579

  # Raises <tt>ActiveRecord::PendingMigrationError</tt> error if any migrations are pending.
  def check_pending!(connection = Base.connection)
    raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection)
  end

  def load_schema_if_pending!

#24

Run this command, then try again.

Essentially, if the database is in the middle of a transition, trying to run rails server won’t work.


#25

I assume that I need to stop the rails server and then run the code.

bin/rails db:migrate RAILS_ENV=development

No luck.


#26

Were you getting that error locally or on heroku?


#27

I run the rails server command in bash and then go to http://localhost:3000 on my browser and I get.

ActiveRecord::PendingMigrationError
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development
Extracted source (around line #576):
574
575
576
577
578
579

Raises ActiveRecord::PendingMigrationError error if any migrations are pending.

def check_pending!(connection = Base.connection)
raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection)
end

def load_schema_if_pending!

In the Terminal I get a similar error message.
ActiveRecord::PendingMigrationError (

Migrations are pending. To resolve this issue, run:

    bin/rails db:migrate RAILS_ENV=development

):


#28

Just try rails db:migrate in the terminal


#29

No good. I noticed this, needing to change interger to integer, in the terminal output but don’t know which file it is referring to?

StandardError: An error has occurred, this and all later migrations canceled:

undefined method `interger’ for #ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition:0x007ff90bfd0050
Did you mean? integer
Integer


#30

It’ll be in one of your migration files

Look in the db/migrations folder and you’ll just have to look at the migration files until you see one that as interger rather than integer and fix in and then run rails db:migrate


#31

All good. Thank you!


#32

#33

Hi,
very new newbie here.

I am almost done with the Installfest, but am now stuck on the “heroku run rails db:migrate”.
When I type it in, I don’t get the expected result, instead I get the error message:

▸ ECONNRESET: read ECONNRESET

I searched high and low for whatever this means, and as far as I understand, it’s probably got something to do with my internet sevice provider blocking access to whatever it is I need access to in order to do the migrate thing.

I tried several things without success:

  1. as suggested earlier in this thread:
    group :production do
    ** gem ‘pg’, ‘~> 0.20.0’**
    end
  2. export HTTP_PROXY=http://proxy.server.com:portnumber
    instead of portnumber i would write 80 or 8080. And when that didn’t work:
    export HTTPS_PROXY=https://proxy.server.com:portnumber
  3. it was suggested to try a different network. I only have access to one other network, and I got the same error message when trying there.

+ I probably tried other things I don’t remember anymore.

One suggestion I found to work around this was to run the command in the background to avoid blocking by using “heroku run:detached rake db:migrate”, which yielded the result:

Running rake migrate db on ⬢ nameless-hamlet-88724... done, run.1591 (Free)
Run heroku logs --app nameless-hamlet-88724 --dyno run.1591 to view the output.

So, my question is: did the detached version of the command work? (I’m asking since it says “done” in the output, but obviously it isn’t what the installfest guide tells me to expect).

If not, I have no idea what else to do, and I hope you guys can help me find a solution to this so I can continue with the rest.


#34

That is indeed an error regarding a possible filter or firewall blocking access to Heroku’s server. I get the same error message if I connect to my work’s wi-fi on my laptop.

It looks like the detached command worked. What happens if you run heroku open?


#35

Thanks for the reply.

If I run heroku open I go to the TestApp in the browser, where I was also able to save and create a new drink. So I think that part works how it should, according to the guide. I am just confused about the migrate command, since I don’t exactly know what it’s doing and so therefore cannot know if it went through or not.


#36

If you could create the drink then the migration worked.


#37

Don’t worry too much about the migrate part just yet. This exercise is mostly to make sure your environment is working properly.

You’ll learn more about migrations when you get the Rails portion of the curriculum.


#38

I finished the installfest now, and everything seems ok. Thank you for the help/reassurance!