DAES
DAES

Reputation: 57

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!!

Upvotes: 3

Views: 4199

Answers (4)

Kalaivani M
Kalaivani M

Reputation: 1310

Run this command to run the rails server in production mode

rails s -e production

Upvotes: 7

Deepak Mahakale
Deepak Mahakale

Reputation: 23711

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 i.e. (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

Upvotes: 2

DAES
DAES

Reputation: 57

It runs as local, and uses WEBrick 1.3.1 I want to run using apache + passenger + rails

Upvotes: 0

Drew
Drew

Reputation: 2663

guessing:

RAILS_ENV=production rails s production

to:

RAILS_ENV=production rails s

Upvotes: 2

Related Questions