mongrel

How to restart Rails from within Rails?

假如想象 提交于 2019-12-21 01:17:10
问题 Ok, so I would like to create an action in Rails to restart itself. I did a little searching and found: http://snippets.dzone.com/posts/show/5002 Which suggests 2 commands, one to stop and another to restart. The following kills: ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -KILL $1 The -HUP signal doesn't restart for me, so I tried to mangle the above command (adjusted so the command worked fine with how I was starting the server under

Set MIME type for server

☆樱花仙子☆ 提交于 2019-12-13 05:13:41
问题 i've seen a bunch of topics about setting the MIME types. But, no one helped me. He is my problem: I have a Rails website with bunch of video in .ogv and .mov formats, located in /public folder. I refer to these files in HTML5 video tag. There is no problem with .mov files, they are played nice in WebKit browsers. The problem is with .ogv. I think, it's because wrong MIME type for .ogv. Here is what i get for .mov (correct): $ curl -I http:/mywebsite.com/video.mov HTTP/1.1 200 OK Date: Sun,

Rails Partial (Rails 3, HAML) arbitrarily slow

旧时模样 提交于 2019-12-12 21:18:53
问题 I'm using Rails 3.0.1, HAML 0.3.22, and Mongrel 1.1.5 (and MongoMapper not AR). I'm rendering a list, and each list item is it's own partial. Every time the page renders one of the list item partials takes almost 100X longer to render (and it is an arbitrarily different one each time. Also, needless to say, each item has essentially the same data). Any idea what is going on here? Should I move the logic into a block rather than a partial? Rendered shared/_head.html.haml (5.6ms) Rendered tasks

Ruby on Rails: How to set which development environment an app runs in?

落花浮王杯 提交于 2019-12-12 04:15:16
问题 I'm relatively new to Ruby on Rails and occasionally I find this convention-over-configuration stuff a little confusing as a lot of things seemed to be hidden from the developer, as in this case. I'm using rails 2.3.8 and when I run my app locally through NetBeans 6.9/Mongrel on my system it runs using the development environment parameters.. when I deploy it to a Fedora box and run it there in Apache HTTPD it automatically runs using the production environment parameters. How does my app

Building a Ruby stack on Windows Server: msvcrt-ruby18.dll

天涯浪子 提交于 2019-12-11 08:49:11
问题 I'm attempting to run mongrel_rails, but I get the following: the program can't start because msvcrt-ruby18.dll is missing from your computer Ruby then gives me the following: C:\Users\Administrator>mongrel_rails C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 126: The s pecified module could not be found. - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mong rel-1.1.5-x86-mingw32/lib/http11.so (LoadError) from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require '

How to get mongrel working with bundler?

时光怂恿深爱的人放手 提交于 2019-12-11 08:18:11
问题 Transitioning to bundler with an existing production setup. Naively with a gemfile and setup like: gem "rails", "2.3.8" gem "mongrel", git: "http://github.com/dynamix/mongrel.git" bundle install --path /mnt/app/shared/bundle Starting with bundle exec mongrel_rails start --environment=production ... results in /mnt/app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:166:in `require': no such file to load -- /mnt/services/shared/bundle/ruby/1.9.1/gems

Why do I get an error when starting ruby on rails app with mongrel_rails

我们两清 提交于 2019-12-11 07:48:15
问题 Why do I get following error when trying to start a ruby on rails application with mongrel_rails start ? C:\RailsTest\cookbook2>mongrel_rails start ** WARNING: Win32 does not support daemon mode. ** Daemonized, any open files are closed. Look at log/mongrel.pid and log/mongr el.log for info. ** Starting Mongrel listening at 0.0.0.0:3000 c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/t cphack.rb:12:in `initialize_without_backlog': Only one usage of each socket

Mongrel on windows with rails3

戏子无情 提交于 2019-12-11 06:36:14
问题 I am deploying a rails 3 application on a windows machine and I wan to run the app on mongrel. I have installed mongrel manually (not through bundler). I didn't installed it through bundler because when I tried it, it errors Fetching source index for rubygems.org Could not reach rubygems repository http://rubygems.org Could not find gem mongrel <>=0, runtime in any of the source So I downloaded .gem and installed. But bundler still looks to fetch it from the repository. Also, when I try to

How to implement a progress bar in Ruby?

江枫思渺然 提交于 2019-12-10 20:33:59
问题 We want to implement a progress bar for file uploading in one of our Ruby application. This needs to show the exact percentage of the upload. However, despite our best efforts we could not find a way to implement a progress bar that exactly replicate the file upload process. Can you please help us with this? 回答1: If your are using Apache and Passenger, you can use the Apache progress bar module. Screencast: http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger

Why doesn't mongrel start in Rails 3.2.rc?

戏子无情 提交于 2019-12-10 02:58:20
问题 GEMFILE that starts mongrel gem 'rails', '3.1.0' gem 'mongrel', '>=1.2.0.pre2' GEMFILE that start WEBrick (not mongrel) gem 'rails', '3.2.0.rc2' gem 'mongrel', '>=1.2.0.pre2' 回答1: Starting on Rails 3.2 you must specify the server you want to use, otherwise Webrick will be used. So, to use mongrel, you must place the gem at your Gemfile AND start the server like this: $ rails s mongrel 来源: https://stackoverflow.com/questions/8853338/why-doesnt-mongrel-start-in-rails-3-2-rc