Weekly round-up of Ruby and Rails related news and articles.
Weekly round-up of Ruby and Rails related news and articles.
One of Ruby's better-kept secrets: how to get temporary directory -
Here’s how
require 'tmpdir'
puts Dir.tmpdir
Simply
$:.unshift File.dirname(__FILE__)
Delete the .git directory locally
Recreate the git repostory
git init
touch .gitignore
git add .gitignore
git commit -m 'Initial commit'
Push to remote server, overwriting
git remote add origin <url>
git push --force origin master
Create a new empty branch named “your-new-branch”, clean up, add .gitignore and commit.
git symbolic-ref HEAD refs/heads/your-new-branch
rm .git/index
git clean -fdx
touch .gitignore
git add .gitignore
git commit -m 'Initial commit'
How to install rmagick gem on Ubuntu 10.04? -
Why can’t I remember this?
$ sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
$ gem install rmagick
How to merge branch back into trunk
$ cd /path/to/trunk
$ svn merge --reintegrate http://example.com/path/to/branch
I’m a Kubuntu 10.10 user who want to use Firefox 4. Here’s what I did
Add the Firefox Stable PPA to the system source
sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get install firefox
Remove the Ubuntu modification add-on
sudo apt-get purge ubufox xul-ext-ubufox
Remove the old Firefox 3.6 language pack
sudo rm -rf /usr/lib/firefox-addons/extensions/langpack-en*
Done. Now you have Firefox 4 on your Kubuntu.
When you use after_sign_in_path_for, make sure your root controller is publicly accessible.