How may i connect ruby on rails with sql server on windows - ruby-on-rails-4

Want to use sql server as a database instead of mysql in Windows.What configuration i need to change in database.yml file and what all gems are needed for installation.Please help.

Sorry to disappoint you, but there are no easy solutions for using Rails on a Windows platform. It was not designed to run on Windows and I don't think I would recommend Windows as a platform for a Rails app. Not to say it hasn't been done, but in my experience it would be far easier to setup and run on a Linux platform as it was designed to do.
There is support for MS SQL server and Rails and you can checkout this project for more information.
My recommendation is to learn more about Rails and setting it up the environment, because a red flag to me is that you want to deploy a Rails app and yet do not know how to set it for production. This should be Rails 101 knowledge. Production is just another environment for Rails, there are things you need to be aware of when running a Rails app in production and this information can be found on easily rubyonrails.org.
Put some more time into learning Rails and perhaps setup a Linux virtual machine, deploy your Rails app, and experiment. Once you learn how to deploy Rails on a Linux platform them perhaps it may be a little easier to understand how to go about doing it on Windows.
please refer :-- https://github.com/rails-sqlserver/activerecord-sqlserver-adapter
Or else you can try with this
What is left is to learn is how to use database engine that is probably of the most interest for developers who work on Windows – Microsoft's SQL Server. If you do not have MS SQL Server installed go ahead and download MS SQL Server Express installer from Microsoft's site. I will use version 2014 in this book. Let's first create database that we will use in our Rails application:
osql -b -S localhost -U -P -Q "CREATE DATABASE RwinBookDevel COLLATE SQL_Latin1_General_CP1_CS_AS"
Newest rails adapter for MS SQL Server uses tiny_tds library to connect to MS SQL server and its usage is almost straigtforward. First thing we have to do is to add following two lines to Gemfile:
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
And run bundle install.
With all prerequisites met we can now configure our Ruby on Rails application to use SQL Server. Connection options are displayed below:
development:
adapter: sqlserver
mode: dblib
host: localhost
port: 1433
username: <your_db_user_name>
password: <your_db_password>
database: ABC
Hope this will help you......

Related

Is it possible to build a portable webapp when using oracle with django

I started developing a django webapp which will need to connect to oracle databases. But using oracle with django requires an Oracle client if I'm not mistaken which is platform dependant. If it's not possible to create a portable webapp with django and oracle, could the app use an oracle client install on the machine where the app is running?
Thanks
What do you mean by "portable" exactly ? You can definitely move your Django folder around, especially if you use SQLite for database storage, since a SQLite database is just a file.
All you'll need is Python on the target machine, access to the command line and the ability to install your dependencies with pip.
Then you can just run your webapp with python manage.py runserver.
If this doesn't answer your question, please give more info.

Django Deployment on windows

I am learning python and Django now. I have a question related to deploying Django project on windows 7. I know how to start the test server in django and see the project. But I have to do start the server manually every time I restart the PC. Also I have to keep the terminal window open.
Consider the below scenario for php projects.
We copy and paste the php files in htdocs or www folder in apache server and access them using the respected url. Web Server is running in the background. We dont have to start the server on windows restart.
Is something similar possible with Django on apache or any other server?
If yes, how should I go about it?
Thanks in advance.
For anyone stumbling around for an answer to a similar problem with deploying Django on a Windows server, here is a guide
Deploy Django with Apache and mod_wsgi on Windows Server 2019
To have Apache24 service automatically run on startup, make the changes in Windows Services dialog.

Why does redmine not use the development and test environments?

Why does redmine not use the development and test environments?
In the official installation guide they only show one environment when setting up the databases, advise to run bundler skipping dev and test, and run the rails server in production mode.
I think this instruction describes the installation process only for server (which runs in Production mode). I think it is done this way not to confuse new users (who do not have a lot of knowledge in Rails)
You can easily use this instruction to setup Redmine locally (I did it successfully several times ;). In order to install Redmine locally you should change only few points in the instruction.

Running django sites on two ports with apache

I am running the edx open source platform on an ec2 instance.
It consists of two platforms:
1. lms: runs on 0.0.0.0:80
2. cms: runs on 0.0.0.0:81
There started with the following command
rake lms and rake cms respectively
It's actually a django application (mostly), but i think it is this way because rakefiles are used to provide some more configurations (not really sure)
Since the django server is not meant to be used in production, i want to use apache to run the two services.
Can anyone guide me to do this?
Thanks already :)

Creating a development environment for Django

We are starting a web project with Django (and are pretty new to this), and I was wondering what would been the best way to setup a productive development environment.
Here is some info:
We are 2 developers working on the project
We have a development/production server hosted on Webfactional (using an apache server)
The DB (MySQL) is hosted on this server
We are both using Eclipse with Pydev
The project is hosted on a Github repository
So far, we didn't setup any local development server, we are syncing modifications to the server through Github. But it is not really convenient...
We were thinking of setting up apache servers locally, that uses the remote database, and only sync once in a while.
Do you think it would be better?
Do you have other ideas/additional tips?
Thanks!
Don't try and share servers and databases while you're developing. You'll only get confused.
Each developer should have a local copy of MySQL on their own machine, and run the development server as mipadi recommends. Manage db schema changes via South, and keep data in fixtures or use South's data migrations. Each developer should commit to their local version of the git repository, but only push changes to Github when the particular task is complete and working (or, better, use a remote branch so that changes are synched, but only merge back to master when complete).
A good idea is to have a continuous integration server like Hudson/Jenkins that, after each commit to master, runs the tests and - if they pass - builds an up-to-date version of the site, which you can use for functional/user testing.
Edit to add There's no relationship between the development server and any particular database backend. As I recommend above, it is quite simple to install MySQL or PostgreSQL on your local machine, and use the development server against that. I have been working this way for several years, after initially encountering some of the issues you were worried about when switching between sqlite3 and the production MySQL db.
Django has its own development server that you can use for local testing.