Fixing Wordpress error "There was an error connecting to the server, Please verify the settings are correct." on Ubuntu 11.04

One of the most common error in doing anything on Wordpress is this.

There was an error connecting to the server, Please verify the settings are correct.

It comes in many colours such as FTP error, local connection error etc. The error appears frequently when you change themes, update Wordpress or change plugins. In most cases, the problem is related to the permission issues related to wordpress directory installed on your computer. I think this solution below covers most occurances of this error. Give it a try.

  1. 1. Locate and go into your Wordpress directory. In my case,
  2. cd /usr/share/wordpress
  3. 2. Perform change owner command
  4. sudo chown -R www-data:www-data *

Copy and paste needs a tweak.

"Ctrl + C" "Ctrl + V"

For so many of us today, this act has become as ubiquous as a stroke of a key. We use it numerous times a day. Probably more than the number of times we use "q" in a day. It has undeniably enhanced usability of computers.

It takes many forms. 

Screenshot-1
Cutting is frowned upon by some. Some sees it as an act of eccentricity.

Contextual copying

It's an idea that you copy the context of a piece of content. For example, if you copy a block of text from a website, you copy font size, boldness and other qualities that describe beyond the meaning the pure text conveys. Copy and paste wasn't always like this. Like some other bad tastes, contextual copying started to take foothold during the 90s.

I often find this annoying especially when I am writing documents. 

Screenshot-3

This is annoying.

Why should a snippet of a text retain its decorations when it usually goes contrary to the overall document format? It often becomes more work user has to handle to get rid of text decorations. To avoid this, people paste the text they want to copy into notepad or browser URL bar before they paste the text into a document. 

I feel like it would be more intuitive to expect copying text decorations as a command that should have extra step to perform instead.

I would be happy to hear contrary opinion on this.

Creating Boring Static Pages

I hope to demonstrate at a very basic level, the concept of controller being used to generate view in Rails. Eventually, I will create a skeleton of a modern web 2.0 landing page.

1. Update Gemfile

source 'http://rubygems.org'
gem 'rails', '3.0.10'
gem 'sqlite3'
end

2. On your console, in the Rails directory

>> Bundle Install

3. Create pages_controller.rb and update

class PagesController < ApplicationController
  def home
  end

  def contact
  end

  def team
  end
end

4. Create the following files in this directory, /app/views/pages/...html.erb

  • home.html.erb
  • contact.html.erb
  • team.html.erb

5. Content for the three html.erb can be anything. It doesn't matter for now.

6. Check http://localhost:3000/pages/home

You will see this routing error.

No route matches "/pages/home"

7. Don't worry. Open /config/routes.rb and update

LandingPage::Application.routes.draw do
  get "pages/home"
  get "pages/contact"
  get "pages/team"
end

The error should be gone if you refresh http://localhost:3000/pages/home

get "pages/home" is equivalent to get "pages/home" => "pages#home"

"controller_name/method" => "the way it looks in browser url. # denotes / in the url."

Test driving Mailgun - Running the Mailgun.rb Demo

If you want your Rails application to send email, you should look into Mailgun. Another alternative would be to use Gmail with stmp set up, but using Gmail comes with some restrictions that Mailgun doesn't have. For example, in Gmail, the email sender would be displayed as the address of Gmail account. In Mailgan you can configure it to be different sender.

I was trying out this git package provided by Mailgun to try out. In this demo, I am merely trying to send email

1. I cloned the git package.

> git clone https://github.com/mailgun/mailgun.rb

2. Modify the MailgunMessage::send_text in sending-message.rb to suit your purpose.

 

MailgunMessage::send_text("xxx@xxx.com",
                          "yyy@yyy.com, 'yyy' <yyy@yyy.com>",
                          "Hello text Ruby API",
                          "Hi!\nI am sending the message using Mailgun Ruby API")

 

 

3. Run this command
> ruby samples/sending-messages.rb 

And you are good!

---

If you see an error like this 

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mailgun (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from samples/sending-messages.rb:1:in `<main>'

Add this line at the very top of sending-messages.rb
$: << File.dirname( "." )

---

Application Environment
  • rails version 3.0.10
  • ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

Beginning Refinery CMS on Ubuntu 11

I needed to work with some sort of CMS, but most of the CMS available catered to PHP users. Unfortunately, I don't know anything about PHP. Thankfully, I found out about a solid Ruby on Rails based CMS called Refinery.

Installation of Refinery is straight forward. Some prerequisite for Refinery are Ruby, ImageMagick, and one of SQLite, MySQL, or PostgreSQL as stated in the download page. I only had to install ImageMagick as a prerequisite. 

Go through rest of the download page instructions, and finish off by going through the Getting Started guide.