0

実行中: Apache 2.2.3 Ruby 1.8.7 Rails 2.3.4 Passenger 2.2.5

エラーメッセージ:

/var/www/derscheidfamily/app/controllers/greetings_controller.rb:14: syntax error, unexpected '/', expecting '\n' or ';' 
def app/controllers 
        ^ 
/var/www/derscheidfamily/app/controllers/greetings_controller.rb:20: syntax error, unexpected '/', expecting '\n' or ';' 
def app/helpers 
        ^ 
    Exception class: 
    SyntaxError 
    Application root: 
    /var/www/derscheidfamily

greetings_controller は次のとおりです。

class GreetingsController < ApplicationController
  def hello
  end

  def exists
  end

  def app
  end

  def exists
  end

  def app/controllers
  end

  def exists
  end

  def app/helpers
  end

  def create
  end

  def app/views/greetings
  end

  def exists
  end

  def test/functional
  end

  def create
  end

  def app/controllers/greetings_controller.rb
  end

  def create
  end

  def test/functional/greetings_controller_test.rb
  end

  def create
  end

  def app/helpers/greetings_helper.rb
  end

  def create
  end

  def app/views/greetings/hello.html.erb
  end

end
4

1 に答える 1

0

これらは有効な Ruby メソッド名ではありません。

def app/controllers
end

def app/controllers/greetings_controller.rb
end

# etc...

おそらくいくつかのドキュメントを読む必要があることは別として、これをクリーンな Rails プロジェクトで実行することを強くお勧めします。

./script/generate scaffold greetings

そして、それが生成するものを見てください。基本的な Rails アプリがどのように構成されているかについて、多くのことを学ぶことができます。

于 2009-09-16T20:07:05.193 に答える