Spree fails to start

160 views
Skip to first unread message

Coco's Jungle

unread,
Nov 14, 2009, 1:56:05 AM11/14/09
to Spree
I momentarily had the Rails "Welcome Aboard" screen, and the "About
your application’s environment" showed everything working properly,
but after I re-ran the "rake db:bootstrap" it went back to giving me a
Application error
Rails application failed to start properly
error, and I can't get past this. The db:bootstrap worked fine, and
even added the sample data. I can see it worked using mysql. The
database.yml is right, the environment.rb looks right, the ,htaccess
is right, the dispatch.{f}cgi files have the correct shebang lime, and
I'm stumped.

How do I go about finding the problem from here?

Thanks,
--Mike

Ing. Marcos Ortiz Valmaseda

unread,
Nov 14, 2009, 9:58:59 AM11/14/09
to spree...@googlegroups.com
Do you paste the error here?
Did you install the required gems?
What is your environment?

We need all the information to give you the right solution

Regards
"For me, the purpose is, at least partly, to have joy. Programmers often
feel joy when they can concentrate on the creative side of programming,
so Ruby is designed to make programmers happy."
Yukihiro Matsumoto (Matz), Creator of the Ruby Language

Ing. Marcos Luís Ortíz Valmaseda
PostgreSQL SysDBA && Rails Developer
BI and DWH Apprentice
Centro de Tecnologías de Almacenamiento y Análisis de Datos (CENTALAD)
Universidad de las Ciencias Informáticas (http://www.uci.cu)

Linux User # 418229

http://www.postgresql.org
http://www.postgresql-es.org
http://www.rubyonrails.org
http://www.ruby-lang.org/es/
http://www.planetrubyonrails.org/
http://www.planetpostgresql.org

Jorge Calás Lozano

unread,
Nov 14, 2009, 10:32:54 AM11/14/09
to spree...@googlegroups.com
What steps did you follow? Are your running edge spree? In gem mode or
instance mode? Are you running it locally? Using Webrick, mongrel,
passenger?

It's kind of weird for me since spree is not provinding the default
index.html that renders the "Welcome Aboard" message. And the .htaccess
is not used, nor the dispatch cgi's AFAIK.
--
Jorge Calás Lozano

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

Coco's Jungle

unread,
Nov 14, 2009, 12:55:17 PM11/14/09
to Spree
On Nov 14, 6:58 am, "Ing. Marcos Ortiz Valmaseda" <mlor...@uci.cu>
wrote:
> Do you paste the error here?
> Did you install the required gems?
> What is your environment?
>
> We need all the information to give you the right solution
>
> Regards>
> Ing. Marcos Luís Ortíz Valmaseda

Gracias por ayudarme. Mis disculpas porque lo siguiente es algo largo,
pero he añadido comentarios encapsulados en asteriscos por clarificar
lo un poco.

The voluminous details can be found at:

http://chata.dyndns.org/spree.txt

--Mike

Coco's Jungle

unread,
Nov 16, 2009, 12:45:52 AM11/16/09
to Spree
I set up Spree on my testing server and it works with script/server,
but I still can't get it to wok with Apache2 server. Will Apache only
work in conjunction with Passenger or Mongrel? My site is on
Hostmonster, which supports RoR, but I need to run spree through
Apache2, not WebBrick.

My configuration:
Linux
Rails 2.3.4
Spree latest version
Apache2
Rubygems (all installed via rake gems:install)

My testing site:
-Runs on script/server (WebBrick)
-Fails on Apache

My hosted site:
-Fails on Apache (I suspect configuration problems with Apache, and
perhaps Spree specific configuration changes for Apache.)

I believe that Ruby, RoR, and Spree are not the problem. What I need
are configuration files from a running Apache based Spree site so that
I can configure my Apache appropriately.

Any help will be greately appreciated, and thanks in advance.
Responda en español si así lo prefiere, u répondez en français si vous
préférez. (Ich entschuldige mich. Ich habt alle meine Deutsch
vergessen.)

--Mike

Ryan

unread,
Nov 16, 2009, 6:24:22 AM11/16/09
to Spree
I think that the problem lies with the symlink for the apache
configuration. Make sure that the link points to the public folder of
your app and not just the root of the application directory.

- Ryan

Coco's Jungle

unread,
Nov 17, 2009, 1:26:12 AM11/17/09
to Spree
On Nov 16, 3:24 am, Ryan <ryan.sid...@hotmail.com> wrote:
> I think that the problem lies with the symlink for the apache
> configuration. Make sure that the link points to the public folder of
> your app and not just the root of the application directory.

In Hostmonster, I have a symlink at $HOME/public_html for
everythingstevia pointing to the spree/public folder. This is the
proper configuration for Hostmonster. Spree is beginning to execute,
so I'm now looking at two logs:
1) /var/log/apache2/error.log
2) spree/log/development.log

In my testing server, I discovered that I needed to:
1) "chmod +x dispatch.*"
2) "chmod 0666 spree/log/development.log

Now I get stuck at:
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/
dependencies.rb:380:in `load_without_new_constant_marking': no such
file to load -- create_admin_user.rb (MissingSourceFile)
in the var/log/apache2/error.log.

I find this file:
spree/app/metal/create_admin_user.rb
but I don't know it it's the one since the path didn't print.

I have to stop for tonight. I'll continue looking at this tomorrow.

--Mike

Sean Schofield

unread,
Nov 17, 2009, 9:36:43 AM11/17/09
to spree...@googlegroups.com
The create admin user stuff is a Rails Metal[1] task for ensuring that
there is an admin user (and giving you the chance to create one if you
haven't already done so.) This file is in the Spree gem. Its strange
that it can't be found though.

Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

[1] http://guides.rubyonrails.org/rails_on_rack.html#rails-metal-applications

Jorge Calás Lozano

unread,
Nov 17, 2009, 9:39:56 AM11/17/09
to spree...@googlegroups.com
Not so sure how the metal stuff is working with dispatch.fcgi solution,
I think you consider another hosting solution where you can configure
Apache and run it with REE and passenger. AFAIK the fastcgi solution
never work very well with rails applications.
--
Jorge Calás Lozano

Coco's Jungle

unread,
Nov 17, 2009, 7:03:04 PM11/17/09
to Spree
On Nov 17, 6:39 am, Jorge Calás Lozano <ca...@railsdog.com> wrote:
> I think you consider another hosting solution where you can configure
> Apache and run it with REE and passenger. AFAIK the fastcgi solution
> never work very well with rails applications.

> On Tue, 2009-11-17 at 09:36 -0500, Sean Schofield wrote:
> This file is in the Spree gem.  Its strange that it can't be found though.

Thanks for the help. If the creator of Spree has no idea of what the
problem might be, and the solution my hosting company uses is a poor
choice for implementing a Spree site, then my options are used up.
I've already spent two weeks trying to get this working, and from all
appearances, there is nobody that knows how to solve this problem
(running RoR with Apache). I'll look somewhere else for a shopping
cart. Too bad it didn't work out. I would have liked to use Spree.

I've tried to implement other RoR solutions in the past, but I've
never gotten any of them working. Am I to understand that the reason
for this is that RoR is incompatible or nearly incompatible with
Apache? Or that, at best, it only works well if either Passenger or
Mongrel is used in conjunction with Apache? If this is true, I think
it will limit RoR's growth as compared to other Apache-compatible
solutions. I'm disappointed to hear this.

Thanks again for the help, and good luck.

--Mike

Carl Anderson

unread,
Nov 17, 2009, 7:11:17 PM11/17/09
to spree...@googlegroups.com
It works well with Apache, just not with Fast CGI, which almost no one who develops with RoR uses (kind of chicken and egg problem I suspect). Passenger is easier and for any serious use, better than fast CGI. It takes slightly more work to get it running on a server, but once it is it really rocks. RoR isn't meant for small projects (just as a sledgehammer isn't meant for framing a house); it is just too much overkill and far too much overhead. But most webcommerce projects are really quite large and quite custom. Sure, sometimes they start out small (or the client thinks they are) but they tend to grow rather significantly very quickly. Personally, I'd love a out of the box solution for webstores, but there are too many differences in clients right now for that to really be possible (look at OSCommerce and how much customization is typically done for any serious store). Though I suppose if it was too easy most of us would be out of a job.

Carl

--

You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=.



Coco's Jungle

unread,
Nov 17, 2009, 7:27:37 PM11/17/09
to Spree
On Nov 17, 4:11 pm, Carl Anderson <nexus...@gmail.com> wrote:
> It works well with Apache, just not with Fast CGI, which almost no one who
> develops with RoR uses (kind of chicken and egg problem I suspect).
>
> Carl

Thanks for the comment, Carl. I wish I had understood that two weeks
ago when it would have allowed me to make a better decision about
which way to go. I'm going to talk to Hostmonster support to see if
they will implement REE and Passenger. I'm sure other clients will
want to use that solution in the future also.

--Mike

Carl Anderson

unread,
Nov 17, 2009, 7:48:00 PM11/17/09
to spree...@googlegroups.com
You can take this with a grain of salt, but unless you've got a very forgiving time table, if you aren't already very familiar with at a minimum, Ruby and have already designed at least one ecommerce site in PHP, I'd suggest not starting with Spree. It isn't anything agianst Spree or Ruby on Rails, but just that ecommerce is a very big subject to tackle and you'd be taking on an unbelievable amount of disparate things to learn all at once. I have no idea what your background is so don't take this as an insult (it isn't intended that way at any rate) but implementing an ecommerce site while learning Ruby and Rails is a big task, especially for one person (you may have a team, I don't know). Trying to learn the details of ecommerce on top of that (if you aren't already extremely familiar with developing them already, perhaps in PHP) really is almost too much for one person on most any timescale I've ever had to work with in the past.

I just mention this a bit of a warning. I've had clients in the past who asked for only something very small, but it turned out their idea of small was a bit more like the moon and they literally didn't understand enough to have any clue of what was involved and I spent the better part of a month teaching them enough of what was involved just so they could figure out what they could really afford (as well as learning their business enough to understand what they really needed). Don't underestimate the amount of work and learning you will need to do. Rails makes rapid development well, rapid, only if you already understand it already. If you don't, then you need to learn Ruby first, just as you'd have to learn PHP before you could really expect to do anything significant with OSCommerce. While Ruby is a beautiful language and I really enjoy using it (far more than I did Perl or PHP) is is still a computer language and takes time and effort to learn. There are gotchas and exceptions that cause hangups and headaches for the person new to it, just like there are for all other languages (computer and otherwise). I only mention all of this because most people who have been using Rails for any length of time already know about the fast CGI problems and most of us already know the replacement solutions and we forget that not everyone has been using RoR for years already.

I used to use slicehost for production and they have some of the very best tutorials on setting up a new Linux host I've ever seen (and they are freely available even if you don't have an account with them). They were something like $20/month for a small slice (ggod for an app or two is they aren't very busy) the last time I used them for a proof of concept. Linode is another one I've heard good things about (though I've never used them and and no affiliated with either company).

Carl


--Mike

Peter Seebach

unread,
Nov 17, 2009, 7:52:21 PM11/17/09
to spree...@googlegroups.com
In message <227a7cb9-8ce3-4058...@y32g2000prd.googlegroups.com>,
"Coco's Jungle" writes:
>I've tried to implement other RoR solutions in the past, but I've
>never gotten any of them working. Am I to understand that the reason
>for this is that RoR is incompatible or nearly incompatible with
>Apache? Or that, at best, it only works well if either Passenger or
>Mongrel is used in conjunction with Apache? If this is true, I think
>it will limit RoR's growth as compared to other Apache-compatible
>solutions. I'm disappointed to hear this.

I've only really tried to make it work with Passenger -- once that came
into existence, it was good enough that I stopped caring about alternatives.

Basically, RoR really doesn't fit particularly well into the traditional
CGI model, because there's a fair amount of startup overhead. Effective
solutions mostly work by changing the way Rails stuff gets run, such that
you don't have all that overhead for each query. Passenger works really
well for me; I've been using it for a while, with a couple of versions
of Rails, and I've had no trouble with it.

-s

Jorge Calás Lozano

unread,
Nov 17, 2009, 7:54:06 PM11/17/09
to spree...@googlegroups.com
Mike, if you really want to stay on shared hosting maybe it's worth to
take a look at Dreamhost, the offer a quite cheap shared hosting with
Apache+Passenger+REE. Anyway for running a RoR app I think that the
choice would be at least a Virtual Host. There are some very cheap
options too. Take a look at Linode and Slicehost to see the prices.

On a shared hosting your application will not be able to scale very easy
and probably you will run out of resources quickly. If you or your
company want to create an e-commerce solution a rock-solid base should
be taken in consideration, I can't imagine myself trying to buy
something from a website is constantly failing.

By the way, Ruby Enterprise is not necessary it's just a plus since they
promise 33% less memory consumption. It's open source and freely
available.

Passenger is Rails/Rack module for apache, just like PHP and
mod_rewrite, but it's kind of complex (I bet) and not as widespread as
PHP. So consider that THE way to run rails applications on apache. If
your hosting company doesn't support it is another problem, and this is
for sure the wrong place to discuss about that or complain.

Hope you finally sort the limitation and start playing on spree, we will
be very happy to help you.
> --
>
> You received this message because you are subscribed to the Google Groups "Spree" group.
> To post to this group, send email to spree...@googlegroups.com.
> To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spree-user?hl=.
>
>

Geoffrey Ducharme

unread,
Nov 17, 2009, 8:52:55 PM11/17/09
to spree...@googlegroups.com

I agree with all that you said here, having been through exactly that experience. It's not impossible, but you'll need to work pretty hard to manage it. 

If you want to give this a shot, I recommend reading Programming Ruby from the pragmatic bookshelf. That book is the best I've read in terms of explaining the most important of Ruby, and I wish it was my first book.

In terms of Rails, I've read a couple of decent books, but nothing exceptional, so read through a couple of them. Maybe someone here could plug a good one?

I also agree with getting a host to have a basic configuration going for you. We had hosted the sites on our server, and given that none of us were Apache experts, what should have been simple configuation issues often turned into day long fights. The last thing you need is to be distracted by these problems.

Finally, if you go through with this, try to find a programmer pair. Doing this was very valuable for me, as someone with experience, right next to you can show you your gaps of knowledge on the spot.

Good luck!

Coco's Jungle

unread,
Nov 17, 2009, 8:53:08 PM11/17/09
to Spree
On Nov 17, 4:48 pm, Carl Anderson <nexus...@gmail.com> wrote:
> Ecommerce is a very big subject to tackle and you'd be
> taking on an unbelievable amount of disparate things to learn all at once. I
> have no idea what your background is so don't take this as an insult (it
> isn't intended that way at any rate) but implementing an ecommerce site
> while learning Ruby and Rails is a big task, especially for one person (you
> may have a team, I don't know).

I don't take any offence at all. On the contrary, I feel honoured to
be able to discuss these things with experts.

As for my background, I've been programming computers for 44 years.
I've worked on machines that went extinct before many of you were
born. I've used languages most of you never heard of. I have years of
experience in building business data storage, retrieval, and analysis
systems (but not ecommerce). I know business (I have a Ph.D. in
Business Administration, once was an adjunct college professor, ran
small companies, etc.)

However, in programming, it's only what you've done in the last 5
years that counts for anything.

I'm old, and I had a job that I was forced to keep, working on C++ and
Visual Basic for 12 years. (Makes you shudder, doesn't it?) It was
paying the bills up to my retirement a year ago.

So now, I feel like I'm starting from scratch, although what a newbie
would learn in 1 year, I can learn in a small fraction of that amount
of time because of my extensive experience. Ruby is the language I
always wished someone would build (I got it instinctively), and RoR is
conceptually easy for me. It is, as you say, just a LOT of stuff to
learn at once. (You forgot to mention Photoshop, CSS, Javascript,
HTML, and Ajax which are also needed.)

I had a site in Zencart (PHP), but I'm going to drop Zencart now. I
also tried ShopSite which has dozens of the ugliest site templates you
could ever imagine, and substruct which also will not run with Apachi
+fastcgi. Spree, by comparison, just looks nicer to me. Spree has a
modern, clean, friendly layout that just *feels right*.

Anyway, I appreciate all the advice all of you are giving me, and I
still want to try to use Spree, now that I've had some encouragement.
I have a requirement for a very small web store (and I hope it does
grow big). I just need something like Spree because 1) I need a quick
start, 2) I want to work with RoR because I know I'll be getting in up
to my neck, and why waste more time on PHP when I could be working in
Ruby, and 3) other solutions also require significant customising to
get anything that looks good, so why not go with Spree?

--Mike

Carl Anderson

unread,
Nov 17, 2009, 9:13:18 PM11/17/09
to spree...@googlegroups.com
All good advice.

I'm glad to hear about your background. Sometimes, on some of the mailing lists I'm on semi-frequently, I'll see someone post who has literally no experience programing and they seem surprised that it isn't easy, which is what I was afraid of at first. I'm glad to hear I was wrong. You should be able to pick it up very quickly; I just wasn't sure.

As far as Photoshop and all the rest of it goes, you are 100% correct. There are so many different things we are expected to do nowadays that is is daunting sometimes. Some days I wake up and I question if I still want to be doing this. And then there are others I can't imagine doing anything else. I imagine it is much the same for others here. I started out doing some PHP and VB programming years ago and found myself doing some automated QA (mostly in Perl, and some Ruby towards the end) for a microfilm-to-digital conversion company in Vancouver Washington which I really enjoyed for a couple of years. They then terminated of their entire IT department and that sucked the life right out of me (as it showed they had no idea how important that department was to what we did). So now I do little programs to convert excel files into html templates for posting on Craigslist, etc I'm trying to set up a web store for a friend using Spree, but he's making it exceptionally challenging due to his schedule.

Carl


--Mike

Sean Schofield

unread,
Nov 17, 2009, 9:15:27 PM11/17/09
to spree...@googlegroups.com
I agree with pretty much everything that has been said here in
response to your problems. Nobody has used Fast CGI for at least two
years now and any host that offers this as their Rails "solution" is
not going to be a very good partner for you.

I wouldn't even worry about the host company for now. Just focus on
getting Spree up and running on your local development machine.
Pretty much all Rails developers develop locally on Mac or Linux and
Rails even ships with a crude web server for testing purposes. You
can find a decent Rails host to help you deploy it and trouble shoot
it later.

Ruby/Rails is a joy to program in. So if you're building software b/c
you love building software then go for it. Otherwise, I agree with
Carl's warnings about getting in over your head.

Good luck.

Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------



Coco's Jungle

unread,
Nov 17, 2009, 10:53:24 PM11/17/09
to Spree
On Nov 17, 6:15 pm, Sean Schofield <s...@railsdog.com> wrote:
> I wouldn't even worry about the host company for now.  Just focus on
> getting Spree up and running on your local development machine.

OK. I can run it using script/server with no problem. I'll work with
it that way to learn what I can until I get suitable hosting
arrangements.

I'm really enjoying talking with all of you. Kindred spirits, I guess.

--Mike

Coco's Jungle

unread,
Nov 18, 2009, 1:20:05 AM11/18/09
to Spree
I installed REE and Passenger on my test server. There were lots of
problems, but I worked through them, and lo and behold, it worked
perfectly. Took me a couple of hours or so.

Word of advice: install Ruby, Gems, Rails, Apache, and Passenger from
Ubuntu packages if you have an Ubuntu server. The other instructions
don't work on Ubuntu. All the Ubuntu packages are Debian packages, so
it's pretty easy that way anyhow.

Thanks, guys.

Now that I know the solution, I'll either get Hostmonster to load REE
and Passenger, or switch to one of the providers you've suggested.

--Mike

Carl Anderson

unread,
Nov 18, 2009, 1:23:52 AM11/18/09
to spree...@googlegroups.com
There are some good articles here for Ubuntu Hardy:

http://articles.slicehost.com/ubuntu-hardy

There used to be a suggestion to not use the Ubuntu packages for gems because it can wasn't possible to get the latest version of ruby gems that way, though I don't know if that is still true since the methods listed in the articles make it easy to install manually.

Carl


--Mike

Bharat

unread,
Nov 18, 2009, 7:21:06 AM11/18/09
to Spree
If you have a basic knowledge of Linux, Linode (www.Linode.com) can be
a good choice too.
I have a couple of sites running on it using RoR and REE, works great.
Bharat

Coco's Jungle

unread,
Nov 19, 2009, 4:16:00 AM11/19/09
to Spree
I signed up for a slice on SliceHost, and installed apache2,
passenger, REE, gems, and Spree as a gem. Then I navigate to a folder
and type
$ spree -d mysql stevia
and I get this error:
/usr/bin/spree:2:in `require': no such file to load -- /usr/bin/../
config/boot (LoadError)
from /usr/bin/spree:2

Here is the gem list:
root@Coco:/var/www# gem list

*** LOCAL GEMS ***

actionmailer (2.3.4)
actionpack (2.3.4)
activemerchant (1.4.1)
activerecord (2.3.4)
activerecord-tableless (0.1.0)
activeresource (2.3.4)
activesupport (2.3.4)
builder (2.1.2)
calendar_date_select (1.15)
chronic (0.2.3)
haml-edge (2.3.86)
highline (1.5.1)
hoe (2.3.3)
json_pure (1.2.0)
rack (1.0.1)
rails (2.3.4)
rake (0.8.7)
rspec (1.2.9)
rspec-rails (1.2.9)
rubyforge (2.0.3)
rubygems-update (1.3.5)
searchlogic (2.3.6)
spree (0.9.2)
tlsmail (0.0.1)

If I browse to a missing page, I get
Apache/2.2.11 (Ubuntu) Phusion_Passenger/2.2.7 Server at
174.143.145.138 Port 80
so I know that's installed right.

root@Coco:/var/www# ruby -v
ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]

root@Coco:/var/www# rails -v
Rails 2.3.4

Some of the gem installs gave me this one or more times:
Could not find main page README.txt
which I ignored, since it was part of the documentation install.

During some installs I got this:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I didn't think it was important, so I ignored it. Everything seems to
work in spite of that error.

Looks like I'm close. Any suggestions, gentlemen?

--Mike

Carl Anderson

unread,
Nov 19, 2009, 10:08:26 AM11/19/09
to spree...@googlegroups.com
These are the gems you need:

 
  config.gem "highline", :version => '>=1.4.0'
  config.gem 'authlogic', :version => '>=2.1.2'
  config.gem 'authlogic-oid', :lib => "authlogic_openid"
  config.gem "activemerchant", :lib => "active_merchant", :version => '>=1.4.1'
  config.gem "tlsmail", :version => '0.0.1'
  config.gem 'activerecord-tableless', :lib => 'tableless', :version => '>=0.1.0'
  config.gem 'haml', :version => '>=2.2.0'
  config.gem 'compass', :version => '0.8.17', :source => "http://gemcutter.org"
  config.gem 'calendar_date_select', :version => '1.15'
  config.gem 'rsl-stringex', :lib => 'stringex', :source => "http://gems.github.com"
  config.gem 'chronic' #required for whenever
  config.gem 'javan-whenever', :lib => false, :source => 'http://gems.github.com'
  config.gem 'searchlogic', :version => '>= 2.3.5'
  config.gem 'mislav-will_paginate', :version => '~> 2.3.11', :lib => 'will_paginate', :source => 'http://gems.github.com'
  config.gem 'pluginaweek-state_machine', :version => '0.8.0', :lib => 'state_machine', :source => 'http://gems.github.com'

and it appears you are missing a few of them. I'm not sure why they weren't installed as dependencies of the spree gem though.

Carl



--Mike

Coco's Jungle

unread,
Nov 20, 2009, 6:27:41 PM11/20/09
to Spree
*** UPDATE ***

OK, I rebuilt my slice and reinstalled everything. There is a good
tutorial for getting started:
<http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1>

I also realized that before installing Ruby stuff, you need:
$ RAILS_OPT="rubygems."

I built a Rails HelloWorld app, and I can't get it to work yet, but I
realized, I CAN DO ANYTHING I WANT ON MY SLICE, and since I haven't
set up IPTables yet, I can run script/server! Then I can test the
Rails app that way.

As it turns out, my HelloWorld app works under script/server, but not
under Apache+Passenger, so I still have an Apache+Passenger
configuration error.

While installing Spree gem, I got a few errors, seemingly related to
documentation.

> Installing ri documentation for builder-2.1.2...
> ERROR: While generating documentation for builder-2.1.2
> ... MESSAGE: Unhandled special: Special: type=17, text="<!-- HI -->"
> ... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation

and several of these:
> Could not find main page README.txt
> Could not find main page README.rdoc

I created the Spree project, did the db:bootstrap and included the
sample data.

It works on
<http://spree.everythingstevia.com/>
but not
<http://spree.everythingstevia.com/admin/>

Both
<http://everythingstevia.com:3000/>
and
<http://everythingstevia.com:3000/admin/>
both work (while I'm running WebBrick).

I haven't configured my SSL cert (I have a real one) or Apache SSL
yet.

'Tis a work in progress.

--mike

Carl Anderson

unread,
Nov 20, 2009, 7:53:02 PM11/20/09
to spree...@googlegroups.com
One thing that sometimes gets people is passenger defaults to production mode, rather than development, so some things work a little differently (error pages, which log file is used, and specific to Spree, whether ssl is used on admin pages by default).

Carl

Coco's Jungle

unread,
Nov 23, 2009, 12:22:35 AM11/23/09
to Spree
Well, I started over with a clean slice, installed Ubuntu 9.04 + ruby
+ rails + spree and tested with WebBrick. Everything worked fine.

Installed nginx + passenger, set up the nginx conf file correctly,
pointed two domains at it. Nginx works fine, and directs each website
to the proper place.

Only problem is, Passenger doesn't kick in. I get this (running under
the nginx user)

nginx@Coco:/$ passenger-memory-stats
--------- Nginx processes ---------
PID PPID VMSize Private Name
-----------------------------------
4095 1 30.3 MB ? nginx: master process /usr/sbin/nginx
4096 4095 30.7 MB 0.6 MB nginx: worker process
### Processes: 2
### Total private dirty RSS: 0.57 MB (?)

--- Passenger processes ---
### Processes: 0
### Total private dirty RSS: 0.00 MB

and

nginx@Coco:/$ passenger-status
*** ERROR: Cannot query status for Passenger instance 4095:
No such file or directory - /tmp/passenger.4078/info/status.socket

and this message is not lying because an ls shows that the info folder
is indeed missing:

root@Coco:/tmp# ls -l passenger.4078
total 4
-rw-r--r-- 1 nginx nginx 4 2009-11-23 02:23 control_process.pid

It is as if Passenger is supposed to be running, but didn't get
started.

Nginx error.log says:

*** Could not start the Passenger helper server (/usr/lib/ruby/gems/
1.8/gems/passenger-2.2.7/ext/nginx/HelperServer): exec() failed: No
such file or directory (2)

Anybody got any ideas? This is the last thing that needs to work for
Spree to run on my slice.

Thanks.
--Mike




Coco's Jungle

unread,
Nov 23, 2009, 2:20:24 PM11/23/09
to Spree
I stopped nginx, reainstalled passenger using gem, moved all the
sources from /usr/local/src to /opt, rebuilt nginx and now when nginx
starts, thepassenger tasks start up.

I have no way of knowing what the problem was, only that it got fixed
by doing this.

Passenger-memory-stats and passenger-status both work properly.

However, Spree is still not running. Nginx+Passenger still looks for
the index.html file.

Are there redirects that are needed?

Coco's Jungle

unread,
Nov 23, 2009, 2:57:58 PM11/23/09
to Spree
Now, when I browse to www.everythingstevia.com, I get this in the
error.log:

2009/11/23 19:50:10 [error] 4504#0: *1 directory index of "/home/admin/
stevia/public/" is forbidden, client: 75.84.60.23, server:
www.everythingstevia.com, request: "GET / HTTP/1.1", host:
"www.everythingstevia.com

This basically says that whatever nginx is looking for, it didn't
find. I know what it's looking for: index.html.

Here's the sites-available part of the nginx configuration:

server {
listen 80;
server_name www.everythingstevia.com everythingstevia.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
root /home/admin/stevia/public;
}
passenger_enabled on;
rails_env production;
}

The message I get at the browser is: 403 Forbidden

I also have another (static) domain on here which works perfectly,
including the favicon.ico.

Any suggestions?

Thanks,
--Mike

Coco's Jungle

unread,
Nov 24, 2009, 5:57:37 PM11/24/09
to Spree
I've got everything working now.

The last hurdle was this server block
server {
...
location / {
root /home/admin/stevia/public;
}
...
}

needs to have the location block removed like this
server {
...
root /home/admin/stevia/public;
...
}

For some reason, you can't use the 'location /' block. I have no idea
why, but I imagine that it changes the routing configuration in a way
incompatible with Passenger. (Passenger does it's own routing; you
don't need it in the server block. You can add routing in
<yourproject>/config/routes.rb if you need it.)

BTW, the documentation DOES SHOW this correctly. I was the one who
added the location block while I was attempting to get it all working.
So, don't be an idiot like me, follow the install instructions
EXACTLY.

*** ALSO ***
Here is the configure I used to build nginx properly -- note the
'install' on the make -- you don't need a "make" followed by "make
install" because the "make install" does a "make clean" first, erasing
the previous "make". I also noted that building nginx this way didn't
install some things, like the /etc/Init.d/nginx script, so do an
"aptitude" install first to get all the superstructure, the customize
it.

$ aptitude install nginx
$ cd /opt/nginx
$ ./configure \
--prefix=/opt/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-pcre=/opt/pcre \
--with-md5=/opt/md5 \
--with-openssl=/opt/openssl \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--add-module=/opt/passenger/ext/nginx
$ make install

Also, I noted that every time I did the "make install" I had to un-tar
the openssl-2.2.7.tar into the openssl folder. Something in "make"
modifies the openssl folder contents. Other folders don't seem to be
affected this way.

I used the following downloads:
md5-1.2.1.tgz
nginx-0.7.64.tar.gz
openssl-0.9.8l.tar.gz
passenger-2.2.7.tar.gz
pcre-8.00.tar.gz
rubygems-1.3.5.tgz

The "passenger-install-nginx-module" command was unable to build the
nginx properly, and that forced me to use the method above.

Don't forget to do a "rake gems:install" in your Spree project to be
sure you have all the gems you need.

Everything else was pretty much according to the instructions
(somewhere).

I hope this helps some other poor suffering Spree installer to get a
successful install.

Voila! Tout est bon!

--Mike

Coco's Jungle

unread,
Nov 24, 2009, 6:05:16 PM11/24/09
to Spree
In another post, Hongli Lai said:

"The location block really isn't needed. But if you do
specify it, then you must also specify passenger_enabled inside the
location block, even if it's already specified outside the location
block."
Reply all
Reply to author
Forward
0 new messages