2012-02-01 13 views
1

私はto generate a modelエラー: ' `class_evalメソッド:そのようなファイルやディレクトリはありません - GETCWD(errnoに:: ENOENT)

rails generate model Ip ip_address:string

コマンドを実行すると、私はのコンソール

`class_eval': No such file or directory - getcwd (Errno::ENOENT)

説明に誤りがfolloing受け取っエラー:

/home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:407:in `class_eval': No such file or directory - getcwd (Errno::ENOENT) 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:91:in `register_klass_file' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:531:in `method_added' 
from (eval):1:in `block in public_task' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:407:in `class_eval' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:407:in `block in public_task' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:406:in `each' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:406:in `public_task' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/generators/rails/app/app_generator.rb:162:in `<class:AppGenerator>' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/generators/rails/app/app_generator.rb:145:in `<module:Generators>' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/generators/rails/app/app_generator.rb:138:in `<module:Rails>' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/generators/rails/app/app_generator.rb:3:in `<top (required)>' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/application.rb:17:in `<top (required)>' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/cli.rb:15:in `<top (required)>' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.1.1/bin/rails:7:in `<top (required)>' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/bin/rails:19:in `load' 
from /home/cis/.rvm/gems/ruby-1.9.2-p290/bin/rails:19:in `<main>' 

モデルを生成するにはどうすればよいですか教えてください。

+1

私はRuby 1.9.3とレールバージョン3.2を使用しています –

答えて

6

はい、私は原因が見つかりました:

私はタブでrails server --debugger

をWEBrickにサーバを開いていたた理由はWEBrickにサーバがすでに実行されている場合、我々はscaffoldgenerate modelのように任意のコマンドを実行することができないことを意味動作しません。

ありがとうございます!

+0

ありがとうたくさんの4 d投票:) –

関連する問題