I have a Rails 3.0 App ready to be deployed on a production server; but as you all might know getting all the gems you need (including Rails 3.0) on a shared hosting is nearly impossible. So here is what need help with:
Can I freeze my app with all the necessary gems and deploy it on Fast CGI?
If yes how do I freeze a Rails 3.0 app?
How do I deploy it on Fast CGI?
I know this is an easy task but I would really appreciate the help.
I have a Rails 3.0 App ready to be deployed on a production server; but as you all might know getting all the gems you need (including Rails 3.0) on a shared hosting is nearly impossible. So here is what need help with:
Can I freeze my app with all the necessary gems and deploy it on Fast CGI?
If yes how do I freeze a Rails 3.0 app?
How do I deploy it on Fast CGI?
With rails3 you use bundler to manage gems.
You can run bundle package to cache them all inside your app, although you probably don’t need to do this - in production bundler by default installs a copy of gems private to the app (no root access required)
Thanks Fred, I was just looking into the bundler thing, I tried to run
rake rails:freeze:gems
but the reply was that the command is depricated and I should try the
bundler install
command instead. I get what that does and it runs perfectly on my machine, but that’s because everything is installed on the normal gems folder,
/usr/lib/ruby/gems/1.8/gems
However, the freezing process was need because it copies these gems to my applications 'vendor ’ directory. So when you say
…
You can run bundle package to cache them all inside your app, although you probably don’t need to do this - in production bundler by default installs a copy of gems private to the app (no root access required)
…
I would assume that it means bundler does the same thing of moving my gems to somewhere in the application’s directory. So in short my question to you would be: how do I do that?
Ok I've packed (not frozen) my app using bundler, and here is what I've done
on the server:
1. Created a directory to upload my files to.
2. Using a web interface I managed to create a symlink to my application
directory
Now what should I do next?
Do you have to use fastcgi? It fell out of favour a long time ago
(last time i used fastcgi was back in 2006)
Rails used to autogenerate a dispatch.fcgi and an htaccess file that
were setup to work with apache, however i don't think it does anymore.
Your life will be a whole lot easier if you can switch to passenger
(as far as I'm aware that's what most shared hosting companies used
too since it's a lot easier for them too).
I think you need rvm, it lets you create a .rvmrc file which specifies which gem set to use, it works like magic, you can have one gem set for each project and even a different ruby version for each, you will fall in love with it.
Thanks radhames, but I think RVM is for your local machine, I’m trying to deploy my app on to a public shared hosting server, which I have no control over. So RVM is not an option. Thanks for your help though.
Thanks for you help again, I wish I could try passenger but I’m making this app for a client and he insisted on sticking with this particular host company since they have been doing business for a long time. Talk about customer loyalty!
Anyways, where does rails keep the dispatch.fcgi and .htaccess files ? Of course what are their contents? Is it the same as suggested by this guy on github.comhttps://github.com/dre3k/rails3_fcgi ? He is saying that it should be in the public folder.
I think you will find that even if you get it going that rails is not
reliable with fcgi. My hosting company moved to passenger a long time
ago to get away from such problems.
Thanks for you help again, I wish I could try passenger but I'm making this
app for a client and he insisted on sticking with this particular host
company since they have been doing business for a long time. Talk about
customer loyalty!
Anyways, where does rails keep the dispatch.fcgi and .htaccess files ? Of
course what are their contents? Is it the same as suggested by this guy on
github.comhttps://github.com/dre3k/rails3_fcgi? He is saying that it
should be in the public folder.
They should indeed be in the public folder. That repository you linked
to looks reasonable at first glance - worth a go I'd say.
Thanks radhames, but I think RVM is for your local machine, I’m trying to deploy my app on to a public shared hosting server, which I have no control over. So RVM is not an option. Thanks for your help though.
Regards,
Tsega
–
You received this message because you are subscribed to the Google Groups “Ruby on Rails: Talk” group.
Jaz if you are looking for a hosting plan that is affordable, has a good deal of features on a shared server. You should look into site5.com . They offer a solid service, I use them for hosting a Spree (E-commerce Ruby on Rails app ) based website. As Colin suggested they use passenger(I think they even have git integration) so you can give them a try.
I have finally given up, I mean on getting rails to work on this hosting account, I think I would have to use another programming language to make the app, or may be I 'll use CMS like Drupal. Believe me I am already dreading the decision but I have no time to fiddle with the server, my client is getting a little impatient so I would need to act soon. Thanks a lot for all he help, hope to see you here every once in a while.
Don’t deploy a Rails app on a shared server. It’s not worth the hassle and your hands will be bound. Rails is designed to work with VPS and dedicated servers.