Step 4 in README


#1

I’m trying to setup Rforum for the 1st time and I’m confused by step 4:

Setup the database tables:
RAILS_ENV=production rake migrate

I’ve completed the tutorial in the Agile Rails book, but I have no idea
what this step actually is. My guess is that this line needs to be
added to one of the files in Rforum.

All the examples I’ve seen have created the tables from a db schema
files ( i.e. create.sql )

I was just hoping that someone might be able to help point me in the
right direction.

thanks,
RailsRoad


#2

Bryan Wheelock wrote:

I’m trying to setup Rforum for the 1st time and I’m confused by step 4:

Setup the database tables:
RAILS_ENV=production rake migrate

I’ve completed the tutorial in the Agile Rails book, but I have no idea
what this step actually is. My guess is that this line needs to be
added to one of the files in Rforum.

Enter this on the command line.

All the examples I’ve seen have created the tables from a db schema
files ( i.e. create.sql )

RForum is using Rails migrations to create the database.


#3

Hmmm,
When I ran this command:

RAILS_ENV=production rake migrate

I received the following error:
syntax error on line 9, col 2: ` database: rforum’

I looked at the rakefile.rb line 9:
require File.dirname(FILE) + ‘/config/environment’

Which looks to me like it’s requiring environment.rb
However, when I looked at that file, it wasn’t clear what may be causing
the error. I did see line 5:

Uncomment below to force Rails into production mode

(Use only when you can’t set environment variables through your

web/app server)

ENV[‘RAILS_ENV’] = ‘production’

I didn’t think it would be appropriate to uncomment this.

confused,
RailsRoad - aka the Real Newbie :slight_smile:


#4

Bryan Wheelock wrote:

Hmmm,
When I ran this command:

RAILS_ENV=production rake migrate

I received the following error:
syntax error on line 9, col 2: ` database: rforum’

This seems to mean an error in the database.yaml file. If you made
changes to it, could you post the whole content of the file?


#5

Bryan Wheelock wrote:

Thanks for the Support

SQLite is enabled by default. Remember to change the dbfile path.

#production:

adapter: sqlite

dbfile: /tmp/rforum_prod.db

Uncomment this section for MySQL:

production:
adapter: mysql
host: localhost
database: spiritua_rforum
username: spiritua_rforum
password: ********

Indentation matters:

production:
adapter: mysql
host: localhost
database: spiritua_rforum
username: spiritua_rforum
password: ********


#6

Thanks for the Support

SQLite is enabled by default. Remember to change the dbfile path.

#production:

adapter: sqlite

dbfile: /tmp/rforum_prod.db

Uncomment this section for MySQL:

production:
adapter: mysql
host: localhost
database: spiritua_rforum
username: spiritua_rforum
password: ********

Uncomment this section for PostgreSQL:

production:

adapter: postgresql

host: localhost

database: rforum

username: rforum

password:

The following settings are only used for testing and development.

development:
adapter: sqlite
dbfile: /tmp/rforum_dev.db

test:
adapter: sqlite
dbfile: /tmp/rforum_test.db