2011-11-09 14 views
8

hola Soy novato en ruby ​​on rails y estoy intentando ejecutar un programa simple de este blog y estoy frente a muchos errores de problemas. http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/ No se pudo encontrar la solución.

Aquí está el registro de errores.

/home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `load': /home/jeevan/csv/config/routes.rb:64: syntax error, unexpected keyword_end, expecting $end (SyntaxError) 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `block in load' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `load' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `block in load_paths' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `each' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `load_paths' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:13:in `reload!' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:7:in `block in initialize' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `call' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:63:in `block (2 levels) in <module:Finisher>' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `call' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing' 
     from /home/jeevan/csv/config/environment.rb:5:in `<top (required)>' 
     from /home/jeevan/csv/config.ru:4:in `require' 
     from /home/jeevan/csv/config.ru:4:in `block in <main>' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize' 
     from /home/jeevan/csv/config.ru:1:in `new' 
     from /home/jeevan/csv/config.ru:1:in `<main>' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `eval' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `parse_file' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:200:in `app' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:301:in `wrapped_app' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:252:in `start' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap' 
     from /home/jeevan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>' 
     from script/rails:6:in `require' 
     from script/rails:6:in `<main>' 

favor me ayude a cabo en este

+3

Por favor, mostrar su routes.rb – Bjoernsen

+0

Habrá un 'desaparecidos end' alguna parte, y que se detecta en la línea 64. – mliebelt

+0

@mliebelt incorrecto revés ;-) –

Respuesta

24

Esto significa que hay un error de sintaxis y se traduce como "se encuentra la palabra clave end cuando no se esperaba nada más para completar el programa". Esto generalmente se debe a un número desequilibrado de "abridores". Por ejemplo,

foo.rb: (demonstration)

if true 
    puts "hello world" 
    end # the indent 
end  # is a lie 

Línea 4: error de sintaxis, inesperada KEND [keyword_end], esperando $ end de codificación

feliz.

+2

"esperando $ END" no rubí palabra clave final, su un error del analizador de bisontes. – Surya

4

Si bien esto suele ser un error de sintaxis, he encontrado exactamente el mismo mensaje de error debido a un problema desconocido con una gema en mi gemset RVM. Si no ve errores de sintaxis, intente eliminar y volver a crear su gemset.

0

También he conseguido esto sin tener un extra end al omitir una coma de routes.rb

0

llegué error similar. Descubierto, fue debido a que mi editor cambió las comillas " 'inteligentemente' en el editor de mac.

Cuestiones relacionadas