Newbie question

Hi I deployed foodsoft locally but when I go to localhost:3000 my page looks like a back-end page with All frame, local variables, instance variables, local variables, etc. How do I access the front-end login page of foodsoft?

Thanks!

Hi, this probably is the development error console. What message does it give on top? Chances are that you still need to setup (or migrate) the database.

  • Willem

Hi Willem,

Thanks for the quick reply!

You’re right the error at the top says:
ActiveRecord::PendingMigrationError at /
Migrations are pending

so i need to execute the command:
bin/rake db:migrate RAILS_ENV=development

but when I do I get the error :
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table ‘users’ already exists: CREATE TABLE users (id int(11) auto_increment PRIMARY KEY, nick varchar(255) NOT NULL, password_hash varchar(255) NOT NULL, password_salt varchar(255) NOT NULL, first_name varchar(255) NOT NULL, last_name varchar(255) NOT NULL, email varchar(255) NOT NULL, phone varchar(255), address varchar(255), created_on datetime NOT NULL) ENGINE=InnoDB

I’ve never worked with an sql database before but I’m guess there’s a file or table I need to delete somewhere?
Any advice would be helpful.

-Alie

So I deleted the users table in foodsoft_development, but now I get the error

Mysql2::Error: Table ‘foodsoft_development.settings’ doesn’t exist: SHOW FULL FIELDS FROM settings

any advice?

Thanks!

Hi,

It sounds like you don’t have any valuable information in your database. Then it would be easiest to re-create it completely (assuming you’ve checked out the git repository):

$ git checkout db/schema.rb # to make sure you have the stock version
$ rake db:drop db:setup

If you still get a migration error, something is wrong with the source-code (outdated database schema). You can try running rake db:migrate and may be lucky. If that doesn’t work either, get the latest stable version of Foodsoft (which was tested more than master):

$ git checkout db/schema.rb # to allow the next checkout in case the database schema changed
$ git checkout latest-release
$ rake db:drop db:setup

Does that help a bit?

  • Willem

Wow! Thanks that was exactly what I needed!
Your the best!