1
votes

* I'm going to learn Rails 3.1 better before I continue with this. Thanks for your help, everyone: I learned a lot! *

I'm trying to create an online portfolio based on Gullery, but I'm stuck at the very beginning: I can't create a database. When I run 'rake db:create', I get the following error:

rake aborted!

C:\Sites\gullery/RakeFile:14: syntax error, unexpected $end, expecting keyword_end

When I run a full trace, I get this:

C:\Sites\gullery>rake db:create --trace

rake aborted!

C:/Sites/gullery/Rakefile:14: syntax error, unexpected $end, expecting keyword_e nd

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_ module.rb:25:in `load'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_ module.rb:25:in `load_rakefile'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:501:in `raw_load_rakefile'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:82:in `block in load_rakefile'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in `standard_exception_handling'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:81:in `load_rakefile'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:65:in `block in run'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in `standard_exception_handling'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:63:in `run'

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `'

C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load'

C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `'

When I searched for "syntax error, unexpected $end, expecting keyword_end" on Google, the answers suggested that I missed an end somewhere. Unfortunately, I don't have the experience to know which file is missing one. Is that even the right problem? If so, where should I look? If not, what's actually going on?

I'm using Ruby on Rails 3.0, Ruby 1.9.2, and mySQL.

Thanks in advance!

EDIT: The contents of C:\Sites\gullery\Rakefile:

# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/switchtower.rake, and they will automatically be available to Rake. require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rdoc/task' RDoc::Task.new do |rdoc| require 'tasks/rails' # Fail if unit tests fail task :default => [:test_units, :test_functional]

EDIT 2: Adding an "end" to the Rakefile eliminates the syntax error, but I the database still won't work.

The new Rakefile:

# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/switchtower.rake, and they will automatically be available to Rake. require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rdoc/task' RDoc::Task.new do |rdoc| end require 'tasks/rails' # Fail if unit tests fail task :default => [:test_units, :test_functional]

And the new error/trace:

C:\Sites\gullery>rake db:create --trace WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/tas k' (in RDoc 2.4.2+)' instead. at C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rak e/rdoctask.rb C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rdoc/task.rb:30: warning: already ini tialized constant Task rake aborted! Don't know how to build task 'db:create' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task_ manager.rb:49:in `[]' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:115:in `invoke_task' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in `block (2 levels) in top_level' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in `each' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:94:in `block in top_level' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in `standard_exception_handling' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:88:in `top_level' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:66:in `block in run' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:133:in `standard_exception_handling' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli cation.rb:63:in `run' C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `' C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load' C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `'
1
You definitely want to show us contents of C:\Sites\gullery/RakeFile or to check what's cracked on 14th line by yourself.jibiel
Is that what the 14 means? That helps to know! I'll add the contents of the RakeFile above.Jessica G.

1 Answers

0
votes

I'm running Rails 3.1 and my Rakefile looks like this:

#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

V0100::Application.load_tasks

V0100 is my application name, corresponds to your "gullery".