unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Rails 3 "RAILS_ENV not defined by config/boot" error
@ 2010-02-18 18:01 John Wulff
  2010-02-18 19:08 ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: John Wulff @ 2010-02-18 18:01 UTC (permalink / raw)
  To: mongrel-unicorn

I'm running unicorn and unicorn-rails 0.96.1 and the latest Rails 3
beta gem.  Firing up unicorn_rails spews "RAILS_ENV not defined by
config/boot".  I know this is likely a result of RAILS_ROOT being
deprecated in Rails 3 but I can't seem to config my way around it.
I'm sure other people must have run into this before.  Is there a
quick fix?

Thanks
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rails 3 "RAILS_ENV not defined by config/boot" error
  2010-02-18 18:01 Rails 3 "RAILS_ENV not defined by config/boot" error John Wulff
@ 2010-02-18 19:08 ` Eric Wong
  2010-02-18 19:13   ` John-Paul Bader
  2010-02-18 23:36   ` Eric Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Wong @ 2010-02-18 19:08 UTC (permalink / raw)
  To: unicorn list; +Cc: John Wulff

John Wulff <johnwulff@gmail.com> wrote:
> I'm running unicorn and unicorn-rails 0.96.1 and the latest Rails 3
> beta gem.  Firing up unicorn_rails spews "RAILS_ENV not defined by
> config/boot".  I know this is likely a result of RAILS_ROOT being
> deprecated in Rails 3 but I can't seem to config my way around it.
> I'm sure other people must have run into this before.  Is there a
> quick fix?

Hi John,

I haven't had a chance to look at Rails 3 yet, but you can probably try
just using a plain config.ru with "unicorn" (not "unicorn_rails")

------------------- config.ru ------------------
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"]
require "config/environment"
use Rails::Rack::Static
run ActionController::Dispatcher.new
------------------------------------------------

Let us know how it goes, thanks!

-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rails 3 "RAILS_ENV not defined by config/boot" error
  2010-02-18 19:08 ` Eric Wong
@ 2010-02-18 19:13   ` John-Paul Bader
  2010-02-18 19:26     ` John Wulff
  2010-02-18 23:36   ` Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: John-Paul Bader @ 2010-02-18 19:13 UTC (permalink / raw)
  To: unicorn list

Hey guys,

actually I was running my new blog on rails3 and unicorn. I wanted to post about it here but didn't have the time yet. Indeed you just need unicorn - not unicorn rails. It seems to run all really well - I just need to modify my rc script a bit.

Kind regards, John

On 18.02.2010, at 20:08, Eric Wong wrote:

> John Wulff <johnwulff@gmail.com> wrote:
>> I'm running unicorn and unicorn-rails 0.96.1 and the latest Rails 3
>> beta gem.  Firing up unicorn_rails spews "RAILS_ENV not defined by
>> config/boot".  I know this is likely a result of RAILS_ROOT being
>> deprecated in Rails 3 but I can't seem to config my way around it.
>> I'm sure other people must have run into this before.  Is there a
>> quick fix?
> 
> Hi John,
> 
> I haven't had a chance to look at Rails 3 yet, but you can probably try
> just using a plain config.ru with "unicorn" (not "unicorn_rails")
> 
> ------------------- config.ru ------------------
> ENV["RAILS_ENV"] ||= ENV["RACK_ENV"]
> require "config/environment"
> use Rails::Rack::Static
> run ActionController::Dispatcher.new
> ------------------------------------------------
> 
> Let us know how it goes, thanks!
> 
> -- 
> Eric Wong
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn@rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
> 

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rails 3 "RAILS_ENV not defined by config/boot" error
  2010-02-18 19:13   ` John-Paul Bader
@ 2010-02-18 19:26     ` John Wulff
  0 siblings, 0 replies; 5+ messages in thread
From: John Wulff @ 2010-02-18 19:26 UTC (permalink / raw)
  To: unicorn list

Fantastic!  Thanks

On Thu, Feb 18, 2010 at 11:13 AM, John-Paul Bader <hukl@h3q.com> wrote:
> Hey guys,
>
> actually I was running my new blog on rails3 and unicorn. I wanted to post about it here but didn't have the time yet. Indeed you just need unicorn - not unicorn rails. It seems to run all really well - I just need to modify my rc script a bit.
>
> Kind regards, John
>
> On 18.02.2010, at 20:08, Eric Wong wrote:
>
>> John Wulff <johnwulff@gmail.com> wrote:
>>> I'm running unicorn and unicorn-rails 0.96.1 and the latest Rails 3
>>> beta gem.  Firing up unicorn_rails spews "RAILS_ENV not defined by
>>> config/boot".  I know this is likely a result of RAILS_ROOT being
>>> deprecated in Rails 3 but I can't seem to config my way around it.
>>> I'm sure other people must have run into this before.  Is there a
>>> quick fix?
>>
>> Hi John,
>>
>> I haven't had a chance to look at Rails 3 yet, but you can probably try
>> just using a plain config.ru with "unicorn" (not "unicorn_rails")
>>
>> ------------------- config.ru ------------------
>> ENV["RAILS_ENV"] ||= ENV["RACK_ENV"]
>> require "config/environment"
>> use Rails::Rack::Static
>> run ActionController::Dispatcher.new
>> ------------------------------------------------
>>
>> Let us know how it goes, thanks!
>>
>> --
>> Eric Wong
>> _______________________________________________
>> Unicorn mailing list - mongrel-unicorn@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
>> Do not quote signatures (like this one) or top post when replying
>>
>
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn@rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
>
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rails 3 "RAILS_ENV not defined by config/boot" error
  2010-02-18 19:08 ` Eric Wong
  2010-02-18 19:13   ` John-Paul Bader
@ 2010-02-18 23:36   ` Eric Wong
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Wong @ 2010-02-18 23:36 UTC (permalink / raw)
  To: unicorn list; +Cc: John Wulff

Eric Wong <normalperson@yhbt.net> wrote:
> John Wulff <johnwulff@gmail.com> wrote:
> > I'm running unicorn and unicorn-rails 0.96.1 and the latest Rails 3
> > beta gem.  Firing up unicorn_rails spews "RAILS_ENV not defined by
> > config/boot".  I know this is likely a result of RAILS_ROOT being
> > deprecated in Rails 3 but I can't seem to config my way around it.
> > I'm sure other people must have run into this before.  Is there a
> > quick fix?
> 
> Hi John,
> 
> I haven't had a chance to look at Rails 3 yet, but you can probably try
> just using a plain config.ru with "unicorn" (not "unicorn_rails")

I've been planning on some large-ish changes in Unicorn 0.97.x to
bin/{unicorn,unicorn_rails} to make maintenance easier and fix
a few minor issues with the existing code.

Would the following change be enough to work with Rails 3
out-of-the-box?

diff --git a/bin/unicorn_rails b/bin/unicorn_rails
index b1458fc..4441c34 100755
--- a/bin/unicorn_rails
+++ b/bin/unicorn_rails
@@ -128,8 +128,6 @@ app = lambda do ||
   rescue LoadError => err
     abort "#$0 must be run inside RAILS_ROOT: #{err.inspect}"
   end
-  defined?(::RAILS_ROOT) or abort "RAILS_ROOT not defined by config/boot"
-  defined?(::RAILS_ENV) or abort "RAILS_ENV not defined by config/boot"
   defined?(::Rails::VERSION::STRING) or
     abort "Rails::VERSION::STRING not defined by config/boot"
 

(I'll remember to test when I fix a few other things elsewhere)

-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-18 23:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-18 18:01 Rails 3 "RAILS_ENV not defined by config/boot" error John Wulff
2010-02-18 19:08 ` Eric Wong
2010-02-18 19:13   ` John-Paul Bader
2010-02-18 19:26     ` John Wulff
2010-02-18 23:36   ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).