简体   繁体   中英

Error Rails 4 console on staging or production

Join in my office the following command:

RAILS_ENV=production rails s production

And I get the following error:

/usr/local/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/handler.rb:78:in `require': cannot load such file -- rack/handler/production (LoadError)

Please, help!!

运行此命令以在production模式下运行rails服务器

rails s -e production

guessing:

RAILS_ENV=production rails s production

to:

RAILS_ENV=production rails s

Sure this is the problem of your command

RAILS_ENV=production rails s production 

change it to:

RAILS_ENV=production rails s

usage of rails s command is :

Usage: rails server [mongrel, thin, etc] [options]

-p, --port=port                  Runs Rails on the specified port.
                                 Default: 3000
-b, --binding=ip                 Binds Rails to the specified ip.
                                 Default: 0.0.0.0
-c, --config=file                Use custom rackup configuration file
-d, --daemon                     Make server run as a Daemon.
-u, --debugger                   Enable ruby-debugging for the server.
-e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                 Default: development
-P, --pid=pid                    Specifies the PID file.
                                 Default: tmp/pids/server.pid
-h, --help                       Show this help message.

so the word following rails s is expected to be server you want to run your application with ie (Thin, WEBrick, FastCGI, CGI, SCGI and LiteSpeed.)

rails s thin
=> Booting Thin
=> Rails 3.2.16 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

rails s WEBrick
=> Booting WEBrick
=> Rails 3.2.16 application starting in development on http://0.0.0.0:3000
=> Ctrl-C to shutdown server

它运行本地,并使用WEBrick 1.3.1我想使用apache + passenger + rails运行

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM