我已经成功安装了mongrel、mongrel_service、win-32 服务 ,并且在我的电脑上也成功安装了该服务并且正在成功启动。
现在遇到的主要问题是,我的应用程序使用了一组 gem,所以在正常情况下mongrel_rails start将以 bundle exec开头。即使服务启动,杂种也不会启动,因为它必须以bundle exec启动。
我的问题是,如何在创建 Windows 服务的命令中包含 bundle exec 以便它将使用 bundle 启动 mongrels?
还有其他方法吗,可能包括 boot.rb 或 preinitializer.rb 中的 bundle exec 以便它自动加载?我正在使用rails 2.3。
杂种日志如下
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment...
c:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/runtime.rb:31:in
`setup': You have already activated mongrel 1.2.0.pre2, but your Gemfile
requires mongrel 1.2.0.pre2. Using bundle exec may solve this.
(Gem::LoadError)
from
c:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/runtime.rb:17:in
`setup'
from**strong text**
c:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler.rb:110:in
`setup'
from c:/xxxxx/xxxxxx/config/../config/preinitializer.rb:17
from c:/xxxxx/xxxxx/config/boot.rb:26:in `load'
from c:/xxxxx/xxxxx/config/boot.rb:26:in `preinitialize'
from c:/xxxxx/xxxxx/config/boot.rb:8:in `boot!'
from c:/xxxxx/xxxxx/config/boot.rb:120
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from c:/xxxxx/xxxxx/config/environment.rb:5
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/rails.rb:147:in
`rails'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in
`cloaker_'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/configurator.rb:149:in
`call'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/configurator.rb:149:in
`listener'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in
`cloaker_'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/configurator.rb:50:in
`call'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/configurator.rb:50:in
`initialize'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
`new'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
`run'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/../lib/mongrel/command.rb:210:in
`run'
from
c:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282
from c:/Ruby/bin/mongrel_rails:19:in `load'
from c:/Ruby/bin/mongrel_rails:19