How to create a new Ruby gem?

Use Bundler From the command line: bundle gem your_new_gem This will create a directory called your_new_gem with just a basic set of files and directory structure that are now considered best-practice. It’s quick, easy, and a great place to start.

Rails: Your user account isn’t allowed to install to the system RubyGems

In my case, I solved doing just what the error message suggests: Your user account isn’t allowed to install to the system RubyGems. You can cancel this installation and run: bundle install –path vendor/bundle to install the gems into ./vendor/bundle/ So, instead of: bundle install I ran: bundle install –path vendor/bundle That was the solution … Read more

Can’t install pg gem on Windows

The message you’re getting is a clear indication that you lack something for the correct installation of that gem: Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. There is no Windows native version of latest release … Read more

Ruby MYSQL2 gem installation on windows 7

EDIT 30/09/2014 When this answer was posted the 64 bit rails installer wasn’t the recommended version – it now seems people are starting to use it more. It should be noted when you download the MySQL Connector you need to download either 64 or 32bit to correspond to the version of rails you installed. Amazingly … Read more

Rails Devise: after_confirmation

I’m using Devise 3.1.2, it has a placeholder method after_confirmation which is called after the confirmation finished successfully. We just need to override this method in User model. class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable # Override Devise::Confirmable#after_confirmation def after_confirmation # Do something… end end See: Devise 3.5.9 Source Code: … Read more

how to install gems without sudo

Use chown on the whole .rvm and .gem directories back to your user. You probably used sudo before and it screwed up permissions. sudo chown -R username:group ~/.rvm sudo chown -R username:group ~/.gem Of course, change username to your username and group to your group

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)