I've a MySQL DB on a Rails app. I've a host&domain. I want to deploy my project. How should I it?
The way to go is Capistrano or Webistrano. Capistrano brings deployment automation to Rails whether you're working with a single server or on a cluster of dozens. Webistrano is a nice Web UI for managing Capistrano deployments. Take a look at the Capistrano Wiki for more detailed information.
Related
I've created my first application using Openshift Tech. It's a Java Web Application running on a JBoss at Openshift and uses MySQL 5.5 as its database. And I have to deploy by it using the war file (I don't know how to do it the normal way).
So anyone can tell me: Should I create a local database or use online database? And is there another way to deploy my Java app not using the war file?
I would suggest that you check out the OpenShift Developer Center (https://developers.openshift.com), specifically this link (https://developers.openshift.com/en/jbossas-overview.html) about using jboss. Make sure you read all of the sections, specifically the Deployment Options, and the Datasources links. If you are interested in just being able to do a "git push" to deploy your code, you should create a new jboss application on OpenShift, and do a "git clone" of the code and check out how it's setup, it is using the Maven project structure, which is pretty common.
I have setup my production server and the rails app is deployed using capistrano 3.1 on nginx and unicorn on Ubuntu Server 12.04LTS. The app is working fine when accessed via normal rails server but whenever I try to run the server via unicorn its says that it cant access some tables in the database. Attached is the snapshot of the error and the snapshot of the database queries.
As noted above in the comments, I cleared the database, the folders and re-ran the deployment after removing the migration extension for capistrano and everything worked just fine.
I'm planning to use multiple databases (mongodb, mysql) for my project.
And I have no idea with it.
Is there anyone can tell me how to connect mongodb and mysql to rails?
or any references?
Thanks.
-I'm using Ruby 1.9.3 and Rails 3.2
You need to setup your rails project with both of the database connections.
Firstly for Mongo, you need to decide which driver wrapper (if you use one) are you going to use. The two common ones are MongoID & MongoMapper. Both do pretty much the same thing and make it easy to interact with Mongo in a similar fashion to ActiveRecord.
To install these you merely install the appropriate gem e.g. for mongomapper you need to run 'gem install mongomapper'
Follow these Railcasts for step by step instructions:
MongoMapper or
MongoID
Now for mysql, again there is a gem to install, 'gem install mysql', and then follow the instructions on the 'getting started' ruby on rails guide to configure your database files.
Remember for both mongo & mysql you will need to have them installed and running somewhere that it accessible from development environment
I am a newbie to rails and have developed a rails application with Rails 3.1 and Mysql and i wanted to host my app and tried heroku which to my surprise doesnot offer mysql hosting out of the box (although offers it with Amazon RDS). I have mysql specific SQL queries in my rails app that doesn't make pluging in postgres any easier. Looking for suggestions on a free hosting provider to host my app with rails 3.1 and Mysql database.
For anybody else looking for options. There are add-ons for Heroku. ClearDB and Xeround are a few. I ended up using ClearDb.
Till recently i've needed to run the dev environment for my Heroku (postgres) app on mySQL.
Obviously this is not ideal (running dev and production on different dbs) and, as the original restriction has been taken away, i'm looking for the best strategy/instruction-set for moving my dev environment over to postgres and either migrating the mySQL data across, or pulling the production data into the new dev db.
What is the best route?
Thanks in advance for any help or direction!
Best bet is to take the simple route.
Install postgres
Setup your local codebase to look at the new
database
rake db:setup
heroku db:pull --app <your production app>