2014-01-07 2 views
-1

어떤 이유로 든 레일즈 콘솔을 프로덕션 환경에서 실행할 수 없습니다. rails console -e production 명령은 Windows 시스템에서 작동하지만 Mac에서는 실패합니다.프로덕션 환경에서 레일 콘솔을 시작할 수 없습니다 : 잘못된 옵션 -e

This SO post이 문제를 해결하는 방법을 설명하고 있지만 누군가가이 오류 메시지를 한 대의 컴퓨터에서만보고 다른 컴퓨터에서 볼 수없는 이유를 설명 할 수 있습니까?

/usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:23:in `block in start': invalid option: -e (OptionParser::InvalidOption) 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:18:in `new' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:18:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

감사!

+1

단지'rails console production' 또는'RAILS_ENV = production rails console'을 시도하십시오. – sevenseacat

답변

2

오류와 마찬가지로 -e은 (레일스 버전에서) 레일 콘솔 명령에 유효한 옵션이 아닙니다. 이것은 올바른 사용법입니다 :

$ rails console --help 
Usage: console [environment] [options] 
    -s, --sandbox     Rollback database modifications on exit. 
     --debugger     Enable ruby-debugging for the console. 
     --irb      DEPRECATED: Invoke `/your/choice/of/ruby script/rails console` instead 
+0

funnily 정도로, 내 대답에'-e' 스위치 .. 세부 사항을 참조하십시오. 이상한! –

0

실제로 저는 -e 옵션을 보았습니다. 재미

rails console --help 

Usage: rails console [environment] [options] 
    -s, --sandbox     Rollback database modifications on exit. 
    -e, --environment=name   Specifies the environment to run this console under (test/development/production). 
            Default: development 
     --debugger     Enable the debugger. 

rails console -e production 

제공 나에게 내가 레일 4.0.1 오전

Loading production environment (Rails 4.0.1) 
irb(main):001:0> 

을 제공합니다.

편집 - 3.2.12에있는 문제에 관한 부분을 놓쳤습니다.

+0

그러나 질문은 3.2.12에 관하여이다. – mechanicalfish

+0

아 - 그리워. 고마워 .. –