LF will be replaced by CRLF
I was getting following message while trying to add files to GIT index: Warning: LF will be replaced by CRLF …. By google search I found that – whenever tried to add files to the repository, git thinks that, the file is a text file and all files automatically will have their LF line endings…
Install mysql2 gem on Windows 7
Last couple of days ago, I was stuck to install mysql2 gem on windows7 for rails3 and tried lots of instructions by googling. Unfortunately, those were not worked for me. Finally, I have specified a older version of mysql2 during installation which worked for me. Following are the steps which i did: Install Mysql 5.5…
Unpacked gem has no specification file
I started working on a new rails project and in every time from command line operation getting this type of irritating message: config.gem: Unpacked gem ….. in vendor/gems has no specification file. Run ‘rake gems:refresh_specs’ to fix this. I run rake gems:refresh_specs but the problem isn’t fixed. Moreover, tried by creating specification file as well….
How to disable logging in Rails application
It’s not a good practice to do though depends on your needs. It can be done by two ways, one is to disable for whole application and another is to disable for specific environments. You’re probably looking for some or all of the following settings: config.loggerconfig.active_record.loggerconfig.action_controller.loggerconfig.action_view.loggerconfig.action_mailer.loggerconfig.active_resource.logger If you set any of them to nil like…
’rails’ is not recognized as an internal or external command, operable program or batch file
You might experience the problem due to the following reasons: You haven’t installed Rails Rails path cannot be found Installed Rails using a ‘special’ installer To resolve the issue, uninstall rails installation from your PC and try a normal installation through command prompt by using following command: gem install rails –include-dependencies Note: Be sure, you…
Remote mysql backups on windows
In our day to day job needs to backup remote mysql database and sometimes may needs to synchronize with another one. It can be done by using following code snippet, no matter the remote server is windows or Linux. Save the following code snippet as a batch(.bat) file and setup a task scheduler. set DATET=%date:~-4%_%date:~7,2%”your…
How to use mutliple ruby version on windows
I have found a nice ruby version manager for windows named pik. It’s pretty easy to install and manage multiple ruby versions. First install the pik gem: gem install pik After installing the pik, you have to use pik_install script to install the pik executable. You must install pik in a different directory other than…
‘nmake’ is not recognized as an internal or external command, operable program or batch file
I have experienced the problem due to the version difference of rubygems installed on my developer PC with gems. I have downgraded the rubygems, to choose the right versions and solved the problem. After completing the installations, updated all of my gems which did not generate any errors. If you still experience the problem then…
Form validation using jQuery
I have written a simple form validation script using jQuery for one of my projects though it have improvement opportunity. Anyone can use it easily by following four simple steps below: STEP 1: Add jQuery plugin to your application STEP 2: Copy following codes in to a JavaScript file and add the file after jQuery…
PHPMailer: Called Mail() without being connected
I was getting the error message to send email using PHPMailer but didn’t get so much help after googling. Then, started to debug the error source and found that it generate for SMTP port and protocol mismatch. Usually, SMTP port is not same for different protocol with/without ssl. So, It’s very important to find the…