I upgraded Ubuntu 9.10 to 10.04. Everything was cool. I tried to work on a Rails project I am involved by issuing the command rake db:migrate to update the database.
I was getting the following error:
Error: uninitialized constant MysqlCompat::MysqlRes
Then I uninstalled the mysql gem and tried to install it again only to get the following error:
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
Then I issued the following command:
sudo apt-get install libmysqlclient-dev
and then installed mysql gem and it installed with no problems. Finally, rake db:migrate worked again.
If you are using zsh as your terminal in Ubuntu, you can use a built in feature to display version control information at the prompt.
After reading “Zsh Prompt Magic” I created the zsh_vcs_info file which you can download. You place it in your home directory and open .zshrc and add the following line:
source /home/user/.zsh_vcs_info
Notice that I added a . (dot) in the filename because I want it to be hidden. Also, notice that “user” in the path above, is the username of the account you use to log into Ubuntu.
I was wondering why some people are using _path and why some use _url. For example, if you have a Post resource you can write the following in your view:
<%= link_to 'List of posts', posts_path %>
or the following in the controller:
redirect_to posts_url
Why should I use _url in the controller. I have used _path and it seems to work.
This is an explanation I found in a forum and I quote:
*_path are for views because ahrefs are implicitly linked to the current URL. So it’d be a waste of bytes to repeat it over and over. In the controller, though, *_url is needed for redirect_to because the HTTP specification mandates that the Location: header in 3xx redirects is a complete URL.
Lets assume you are in a team, working on a Rails project and you have chosen Git as your version control system. One way to complete a working cycle from pull to push is:
DISCLAIMER: There are more ways and many situations that are not described here. This is only a note to self that may also be useful to you.
Read more…
When I am working with git, I find it useful to take a quick look at the log. The default
$ git log
command doesn’t show the actual modified/added/deleted files. You can use the following command for that:
$ git log --pretty --stat
or
$ git log --pretty=format:"[%h] %ae, %ar: %s" --stat
I found the latter in one of Alex Young’s tweets.
If you have any favorite git log formats, please feel free to mention them in a comment.
Open your shell and,
For RSpec:
$ gem install rspec
For Cucumber:
$ gem install cucumber
Optionally, if you are on Windows, for color output you can also install Win32Console:
$ gem install win32console
I really love Highrise. It is a 37signals service that helps you organise your contacts, your conversations with these contacts, cases, deals and tasks. Highrise also sends task notifications using SMS. Unfortunately it only supports specific providers for certain countries only. My country (Greece) as well as many other countries all over the world are not included in that list. Nevertheless, I managed to make Highrise send notifications to my mobile phone through Google Calendar.
Read more…
After changing to CruiseControl.NET 1.4.x, my builds started sending weird Subversion related error messages. You see, my CC.NET server is on a different computer and on a different network than my Subversion repositories server. As a result, CC.NET tries download modifications using the Internet.
Read more…
If you have the right .NET version you can use:
This one is very short, but I think these tips are essential and basic and unfortunately I see many many sites doing exactly the opposite and it is a pity:
- Don’t use flash.
- Don’t have some content as HTML and some as PDF or documents in other formats. You can transfer the content in HTML.
- Don’t have music playing. Please don’t.
- Don’t have animated banners or other moving parts. They distract the reader.
- Use a bigger font and watch spacing.
- Don’t have scrolling text. Please don’t.
There are many many more pitfalls, but I’ll leave you with these. If everyone used these tips, we would have a much better web presence.
Recent Comments