简体   繁体   中英

Running rails on a Production mode in webrick server

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

rails s -e production

The issue is, it works perfectly if its in the development mode, but in server mode I'm getting 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 am using Jammit and POpen4 and my rails version is: 3.0.9. Ruby version 1.8.7. I can't currently upgrade the version as several other developers are involved in the project. Can anybody give me a solution for this.

Thanks

Thanks a lot for everyone who tried to help me regarding this issue. I installed CentOS and everything's have fixed and running smoothly.

That might be some issue with the Windows server 2008 which I was using previously

Thanks a lot

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

Gemfile:

...
gem 'popen4'
...

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

Otherwise your app relies on what you have installed locally on your machine (I suppose via gem install popen4 ).

Here you production machine doesn't have the gem POpen4 installed on it... So the other quick (but no recommended) solution is to install the gem manually on your production machine with gem install popen4 .

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