Ruby / Ruby on Rails

June 14, 2015

Uploading multiple files with Carrierwave in Rails 4

This post shows how to use carrierwave gem to upload multiple files in Rails 4 Let suppose the following scenario. We have multiple projects and each project can have multiple screenshots. In project.rb class Project < ActiveRecord::Base has_many :screenshots accepts_nested_attributes_for :screenshots, […]
June 14, 2015

Validate a url in Rails 4

class User < ActiveRecord::Base validates_format_of :url, :with => URI::regexp(%w(http https)) end Reference: Stackoverflow 
June 14, 2015

Using has_many with Nested Form in Rails 4

This post shows how to use field_for and accepts_nested_attributes_for to created nested form for has_many model Let suppose the following scenario. We have multiple projects and each project can have multiple screenshots. Following will be the definition of model classes. class […]
February 13, 2015

Using Twitter Bootstrap with Ruby on Rails

Step by step guide to integrate Twitter Bootstrap with Ruby on Rails application. Please note that after these steps, your application layout file will be replaced with default one. Step1: Add gem to your Gemfile gem 'twitter-bootstrap-rails' Step 2: Install required […]
January 16, 2015

Error installing debugger gem on ubuntu

I recently encountered error while bundle install. The issue was with debugger gem. Following is the error I was getting No source for ruby-1.9.3-p484 provided with debugger-ruby_core_source gem. extconf.rb failed After searching Google for answer, I found that this gem […]
January 7, 2015

500 error with rails application running in production via apache2 & passenger

I sometimes face 500 Internal Server Error when running Ruby on Rails application on Apache Passenger but the same application is working fine with webrick server. One of the following reasons are responsible for the issue. 1. Permission Issues Check […]
April 30, 2014

Enum column in Rails

Declare an enum attribute where the values map to integers in the database, but can be queried by name. Example: class User < ActiveRecord::Base enum status: [ :admin, :user, :banned ] end  For migration, write  def up create_table :authorities do […]
April 28, 2014

Installing Apache, Ruby, MySQL, Passenger on Ubuntu 14.04

This step by step how to is intended to be a reference for those who are comfortable with working in terminals. This page lists all the commands on one place.
December 9, 2011

How to Restart Ruby on Rails Applications?

If you are running Ruby on Rails application (e.g Redmine) using Apache & Phusion Passenger and need to be restart your application, then you simply have to create a blank text file with name restart.txt in the tmp directory of […]
May 15, 2011

Upgrade Redmine

Login to your server using putty Go to RubyForge and copy the URL of Redmine version you want to upgrade to. Download it to your server using wget command. Go to Redmine Site to check the requirements. Make sure you […]
May 15, 2011

Install RubyGems from Source

If you want to install some previous version of RubyGem or for what ever reason, want to install RubyGem from source, perform following steps Login to your server using putty Go to RubyForge and copy the URL of RubyGem of […]
May 15, 2011

How to remove/uninstall RubyGem from your system

If you installed rubygem with some sore of package management system, it probably provides for an uninstall capability. If not, here is one way to remove it. Find out where ruby installs its libraries. If you don’t know where your […]
May 15, 2011

How to Freeze Gems with recent versions of Rails

If you want to freeze the gems under vendor/gems, just run the following command in your application directory   rake gems:unpack  
April 10, 2011

Remove/Uninstall all gems

gem list | cut -d" " -f1 | xargs gem uninstall -aIx   Source: http://geekystuff.net/2009/1/14/remove-all-ruby-gems
gdpr-image
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.
READ MORE