I installed foodsoft on my server, but I did run into some trouble.
The test with ‘rails server’ did succeed.
But now I’m trying to run foodsoft in production mode with apache and mod-passenger and I get an error massage:
‘git://github.com/technoweenie/acts_as_versioned.git (at master) is not checked out. Please run bundle install (Bundler::GitError)’
The think is I did run bundle install and everything works fine with ‘rails server’.
So, what did I miss?
Is it the ruby environment, the mod-passenger, or foodsoft?
I wasn’t aware that RVM was necessary. So there might be the problem. I’ll go and figure it out.
I’m using a Debian wheezy system with SQLite. The ruby environment was install by apt-get and gems.
Thanks for pointing me to github.com/foodcoop-adam. I only searched in bennibu and the foodcoops repo wikis.
if necessary or not, I can’t tell …
Thing is, that via apt-get I will only get Ruby 1.9.1. So, at least I can get Ruby 1.9.3 via RVM.
And after pointing mod_passenger (/etc/apache2/mods-available/passenger.conf) to right Ruby environment (/usr/local/rvm/bin/ruby-1.9.3-p448) I get from apache:
‘Application error
Rails application failed to start properly’
Some kind of a progress. Something went wrong with my mod_passenger installation. Hope to fix it soon…
It turns out, that it is a bad idea to use RVM and still install mod_passenger via apt-get. bad on me.
But, sorry, it is still not running. Now I get:
(2)No such file or directory: exec of ‘/srv/foodsoft/public/dispatch.cgi’ failed
Premature end of script headers: dispatch.cgi
The first line of dispatch.cgi is: #!/usr/bin/ruby1.8
I already know from Benni that you don’t use the dispatch.cgi anymore.
My /etc/apache2/sites-available/foodsoft is:
<VirtualHost *:80>
ServerName foodsoft.example.org
DocumentRoot /srv/foodsoft/public
<Directory /srv/foodsoft/public>
Allow from all
Options -MultiViews
ErrorLog /srv/foodsoftlog/error.log
What’s wrong? What and how to use something different then dispatch.cgi?
It turns out, that it is a bad idea to use RVM and still install
mod_passenger via apt-get. bad on me.
Oh, that’s a nuisance.
But, sorry, it is still not running. Now I get:
(2)No such file or directory: exec of
‘/srv/foodsoft/public/dispatch.cgi’ failed
Premature end of script headers: dispatch.cgi
The first line of dispatch.cgi is: #!/usr/bin/ruby1.8
I already know from Benni that you don’t use the dispatch.cgi anymore.
My /etc/apache2/sites-available/foodsoft is:
<VirtualHost *:80>
ServerName foodsoft.example.org
DocumentRoot /srv/foodsoft/public
<Directory /srv/foodsoft/public>
Allow from all
Options -MultiViews
ErrorLog /srv/foodsoftlog/error.log
What’s wrong? Waht and how to use something different then
dispatch.cgi?
Yes, I’ve removed those files since they use features not present in
Rails 3 anymore.
Current practice is to use passenger with the Rack interface [1], which
looks at config.ru .
I am going to talk about shared servers and foodsoft.
I did try the heroku route as well multiple times during the summer. It did not work either. I definitely want to help develop eventually, but I am still at the beginning of understanding ruby on the rails framework. On the capistrano stuff I am completely lost. I have no idea what to do with it.
I think it is plausible that a large portion of the people who will be interested in using foodsoft will have access to a shared server through a service like Dreamhost (DH). That is to say, they are already paying for this, and probably do not want to make a practice of buying new hosting.
But running apps using ruby 1.9.3 on DH appears to only be possible through FastCGI. Their Passenger install uses rails 1.8.7, so it’s a “no go”. As was posted above, I have been trying to get this particular setup working since it is the only place on the internet where someone says they have 1.9.3 working on DH.
But deploying foodsoft to dreamhost even with these tools has been elusive. Before latest bunch of changes to the foodsoft git, I was at least getting some errors, but now I just get nothing.
There is some discrepancy as to where dispatch.fcgi should go. Micah Chalmer says it should go directly in /home/sampleuser/example.com while dreamhosts rails wiki says it should go in /public.
Here’s the quote from Micah:
“All the files below should go in your project root directory, which should also be configured as your web directory in the DreamHost panel. Usually that means if your site was example.com and your user was sampleuser then you’d be putting these files, along with your Rack app, into /home/sampleuser/example.com.”
Recently I’ve removed dispatch.fcgi, because it didn’t work anyway -
being left-over from Rails 2.
I guess you read http://wiki.dreamhost.com/Rails_3
This also contains a sample dispatch.fcgi. I would say it goes into the
public directory - that’s where web-server accessible files go. It
doesn’t actually matter where the goes - as long as it can be served as
an fcgi file and dispatch.fcgi knows where to find foodsoft’s
installation directory (for environment.rb, I guess).
I’ll be happy to include dispatch.fcgi in foodsoft’s public directory,
when it actually works.
Willem
p.s. At this moment, Capistrano is probably untested.
Right now I have my home server running and I have lafoodcoop.org pointing to it (on port 3000).
My up speed is 1mbps, which appears to be more than enough to serve one user at a time. Since there are only about 30 of us, maybe this could work until I get it working with Dreamhost. This way we have many more people generating errors, which may be a good thing for development.
Can I make development https protected?
The only error I saw was when I tried to save a wiki page:
Too bad it doesn’t work out yet. I think a home server would be ok to
start with.
I’d strongly advise to use a production setup - the default development
setup allows to run arbitrary code when an error occurs, for example.
Just use the production environment. You need to precompile your assets.
The typical steps for updating production would be:
git pull
bundle install (when Gemfile or Gemfile.lock was changed)
[only when using additional plugins] RAILS_ENV=production rake
railties:install:migrations
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake assets:precompile
restart your webserver (with passenger: touch tmp/restart.txt)
And the easiest way would be to execute RAILS_ENV=production rails s so that the production settings are loaded. Remember to precompile the assets first, as described earlier too RAILS_ENV=production rake assets:precompile I’m curious to hear how your ordering cycle went, please feel free to share about that! - Willem