How do I fix the “You don’t have write permissions into the /usr/bin directory” error when installing Rails?

I’m trying to install Rails 3 on a brand new MacBook Pro running OS X 10.6.3, Ruby 1.8.7, and Rails 2.3.5 and I’m wondering if I’ve hosed myself. So far, I’ve run these commands: $ gem update –system $ gem install arel tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n $ … Read more

Understanding :source option of has_one/has_many through of Rails

Please help me in understanding the :source option of has_one/has_many :through association. The Rails API explanation makes very little sense to me. “Specifies the source association name used by has_many :through => :queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, :through => :subscriptions will look for either :subscribers … Read more

rmagick gem install “Can’t find Magick-config”

I get the error shown below when attempting to install the rmagick gem. I am on Snowleopard 10.6 using RVM, Ruby 1.9.2-head and Rails 3.05. Responses to similar questions recommended installing ImageMagick, which I successfully did. Other suggested installing the “libmagick9-dev library”, however, I can not figure out how to do this. I’m a new … Read more

Separate REST JSON API server and client? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago. Improve this question I’m about to create a bunch of web apps from scratch. (See http://50pop.com/code for overview.) I’d … Read more

Adding a column to an existing table in a Rails migration

I have a Users model which needs an :email column (I forgot to add that column during the initial scaffold). I opened the migration file and added t.string :email, did rake db:migrate, and got a NoMethodError. Then I added the line add_column :users, :email, :string again rake db:migrate, again NoMethodError. Am I missing a step … Read more