Running rails in production mode on webrick server

In my current ruby ​​on rails project, I am using the webrick (default) server for development. I have a separate server for testing the application, and I want to install an environment for it. I used the following line to start the server in production mode.

rails s -e production 

The problem is that it works fine if it is in development mode, but in server mode I get the following error:

 Started GET "/" for 172.20.7.94 at Thu Jun 07 10:35:45 +0530 2012 Processing by FrontendController#dashboard as HTML Rendered frontend/dashboard.html.erb within layouts/frontend (3.0ms) Completed 200 OK in 50ms (Views: 22.0ms | ActiveRecord: 0.0ms) Started GET "/assets/frontend-datauri.css" for 172.20.7.94 at Thu Jun 07 10:35:4 6 +0530 2012 Processing by Jammit::Controller#package as HTML Parameters: {"extension"=>"css", "package"=>"frontend-datauri"} Completed 500 Internal Server Error in 190ms NameError (uninitialized constant POpen4::Open4): Started GET "/assets/frontend.js" for 172.20.7.94 at Thu Jun 07 10:35:46 +0530 2 012 Processing by Jammit::Controller#package as Parameters: {"extension"=>"js", "package"=>"frontend"} Completed 500 Internal Server Error in 105ms NameError (uninitialized constant POpen4::Open4): 

I use Jammit and POpen4, and my rails version is 3.0.9. Ruby version 1.8.7. Currently, I cannot update the version, as several other developers are involved in the project. Can anyone give me a solution for this.

thanks

+8
ruby ruby-on-rails ruby-on-rails-3
source share
2 answers

Many thanks to everyone who tried to help me solve this problem. I installed CentOS and everything fixed and runs smoothly.

This may be a problem with the Windows 2008 server that I used earlier.

Thank you so much

+1
source share

The best practice is to define your dependencies in your Gemfile.

Gemfile:

 ... gem 'popen4' ... 

and then run bundle install to create a specific set of gems for your application.

Otherwise, your application will rely on what you installed locally on your computer (I guess via gem install popen4 ).

Here your production machine does not have gem POpen4 installed on it ... So another quick (but not recommended) solution is to manually install the gem on your production machine using gem install popen4 .

0
source share

All Articles