Why can't I migrate the rforum db?

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.16-standard

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database rforum_dev;
Query OK, 1 row affected (0.01 sec)

mysql> create database rforum_test;
Query OK, 1 row affected (0.00 sec)

mysql> create database rforum;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on rforum_dev.* to ‘intention’@‘localhost’;
Query OK, 0 rows affected (0.05 sec)

mysql> grant all on rforum_test.* to ‘intention’@‘localhost’;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on rforum.* to ‘intention’@‘localhost’;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
65-182-44-226:~/work/rachet_working/rforum/trunk intention$ rake migrate
(in /Users/intention/work/rachet_working/rforum/trunk)
rake aborted!
parse error on line 22, col 0: development:' /Users/intention/work/rachet_working/rforum/trunk/rakefile.rb:9 (See full trace by running task with --trace) 65-182-44-226:~/work/rachet_working/rforum/trunk intention$ rake migrate --trace (in /Users/intention/work/rachet_working/rforum/trunk) rake aborted! parse error on line 22, col 0:development:’
/usr/lib/ruby/1.8/yaml.rb:119:in load' /usr/lib/ruby/1.8/yaml.rb:119:inload’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:424:in
database_configuration' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:168:ininitialize_database’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:83:in
process' /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:insend’
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in run' /Users/intention/work/rachet_working/rforum/trunk/config/environment.rb:10 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in require' /Users/intention/work/rachet_working/rforum/trunk/rakefile.rb:9 /usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1641:inload’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1641:in
load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1713:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7
/usr/bin/rake:18:in `load’
/usr/bin/rake:18

Bryan W. wrote:

parse error on line 22, col 0: `development:’

Make sure you don’t have any spaces in the “development:”,
“production:”, “test:” lines, and that the other lines are indented with
2 spaces each.

I’m trying to setup rforum locally.
I created the db’s in mysql, set database.yml
When I attempted rake migrate I got the following error:

parse error on line 22, col 0: `development:’

I checked database.yml for tabs and did not see any.

Here is the text of the database.yml file.


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: rforum
username: rforum
password:

Uncomment this section for PostgreSQL:

production:

adapter: postgresql

host: localhost

database: rforum

username: rforum

password: pass

The following settings are only used for testing and development.

development:
adapter: mysql
host: localhost
database: rforum_dev
username: rforum_dev
password:

test:
adapter: mysql
host: localhost
database: rforum_test
username: rforum_test
password:

Bryan W. wrote:

I’m trying to setup rforum locally.
I created the db’s in mysql, set database.yml
When I attempted rake migrate I got the following error:

parse error on line 22, col 0: `development:’

Please take a look at Need help in setting this thing up - Ruby-Forum - Ruby-Forum.

Bryan W. wrote:

I have checked and rechecked database.yml and there are no tabs.

I fully reinstalled Ruby and Rails yesterday.

I attempted to

$ rake migrate --trace
(in /Users/intention/work/rachet_working/rforum/trunk)
rake aborted!
syntax error on line 59, col 0: `registration_email_sent:
?Ñ·???Email??%s’

Please delete all lang/* files that you don’t need, it should work then.
I’m not sure why you are getting this error, but I think there is a YAML
bug in a certain Ruby Version (1.8.3?).

I have checked and rechecked database.yml and there are no tabs.

I fully reinstalled Ruby and Rails yesterday.

I attempted to

$ rake migrate --trace
(in /Users/intention/work/rachet_working/rforum/trunk)
rake aborted!
syntax error on line 59, col 0: registration_email_sent: ?Ñ·???Email??%s' /usr/local/lib/ruby/1.8/yaml.rb:133:inload’
/usr/local/lib/ruby/1.8/yaml.rb:133:in load' /Users/intention/work/rachet_working/rforum/trunk/lib/localization.rb:44:inload_localized_strings’
/Users/intention/work/rachet_working/rforum/trunk/lib/localization.rb:42:in
load_localized_strings' /Users/intention/work/rachet_working/rforum/trunk/config/app.rb:20 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
require' /Users/intention/work/rachet_working/rforum/trunk/config/environment.rb:52 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
/Users/intention/work/rachet_working/rforum/trunk/rakefile.rb:9
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1641:in
load_rakefile' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1713:inrun’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7
/usr/local/bin/rake:18


I found 2 references to the snippet ( registration_email_sent: ) in
rforum:
lang/en.yaml line 63
lang/ro.yaml line 56

There are no tabs in either file.

Andreas S. wrote:

Bryan W. wrote:

rake aborted!
syntax error on line 59, col 0: `registration_email_sent:
?Ñ·???Email??%s’

Please delete all lang/* files that you don’t need, it should work then.
I’m not sure why you are getting this error, but I think there is a YAML
bug in a certain Ruby Version (1.8.3?).

I get the exact same problem with top-of-tree (though not with 0.2).
It’s the localization file cn.yaml: I assume Ruby isn’t interpreting the
text encoding correctly (the file does say “file_charset: GB18030” at
the top.)

I’m running Ruby 1.8.4 and Rails 1.1 on Mac OS X 10.4.6. Is it possible
that the encodings supported by Ruby are platform-dependent? Maybe OS X
doesn’t include support for this encoding. Converting the file to UTF-8
would be a good solution.

As a workaround I’ll just delete the file from my working set…

–Jens