Ruby On Rails Environment on Ubuntu 12.04 3

Posted by JD 07/18/2012 at 17:00

I attended a local Ruby Meetup last week where they showed how to get all the dependencies for a smart RoR setup on Ubuntu. I’ve only tested it on 12.04 myself, but something similar should work for 10.04. I have doubts whether installing on 8.04 is this easy for the current versions of RVM, Ruby and Rails.

The installation instructions came from a gist from Cajun_Code. Following those instructions makes this process fairly straight forward. We’ll install RVM, Ruby v1.9.3, Rails, SQLite3, nginx and thin to get started.

Updated for Rails4 and Ruby 2.0.0 at the bottom of the article.

Blog Spammers Hit 4

Posted by JD 04/17/2010 at 09:39

Blog Spam

I’ve noticed the number of blog spammers have increased significantly in the last 2 months. They use general “good job” or “nice work” comments, then leave their email and commercial weblink. I assume these are spam-bots – automatically doing it.

Moderated Comments

Since all comments are moderated here, I’ll do my best to weed them out if they aren’t related to the posted article. Only on-topic links will remain and generic posts will not be allowed. It isn’t like there are hundreds of spam posts daily. I know this will reduce the number of comments, but that is the price for non-spam comments today. Sorry. If you’re comment is on topic, it will be posted. Basically, any comment that is remotely on topic will be posted. Just those that are commercial or links to unrelated content will not be posted. For example, if the post is about virtualization and you provide a comment with links to an online vitamin store, that will not be posted. OTOH, if links in comments are to other articles on virtualization or even commercial virtualization products, then it will be allowed. The decision of moderators leans towards posting comments when in doubt.

Test Messages

I guess some people don’t want to bother writing a longer message if it won’t be posted. I get that, but a test message is not on topic either and won’t be posted. How does that comment add to the conversation?

Further, I’ve disabled comments for older articles. I don’t recall the actual cutoff day. It is probably 90 or 120 days, so it won’t impact the few, loyal, readers. Those articles do not have any way to enter any comments. If there is a comment field displayed, then your comment will be seen by the moderators.

Hello, Nice Article and other non-related comments were allowed previously, but are not going forward. Sorry. Those do not add to the conversation.

English Only Please

This is an English language blog. While we like worldwide viewers and understand that not everyone reads English, that is simply a limitation of our skills. I have translated some non-English comments previously. None were on-topic to the post. We may attempt to translate comments again, but you can visit translate.google.com just as easily as we can.

No Sign-up Required

We do not require any sign up to post comments. Heck, we don’t really want your email address either. An alias is preferred. If you leave an email address or web address, it will probably be included in the comment and publicly seen. That seems to be the way this software works. Our systems do log IP addresses, just like every other system out there does.

Example Blocks

A few of these spammers have been blocked at the router. Sure they can come from a different subnet, but I bet they won’t.

The financial planning and foreign internet diamond sellers are the funniest. Blocked.

Automatic Moderation

I’ve looked into viable solutions to allow non-moderated comments here and didn’t find one that I was willing to implement.
Here’s a site from 2005 with specific ideas to reduce, if not eliminate internet marketing on blogs. About a year ago, I came across another site where the blogger had placed a static Captcha with an simple arithmetic problem inside the image. The answer was always “42.” He never changed it, Never, yet it prevented 100% of the blog spam. I may introduce that here.

If I were running MT or blogger or some other highly popular blog tool, then I’d have a bigger issue. Since I’m running a little used Ruby blog with few internet users, I’m fairly safe just like Linux and Apple are safe compared to Microsoft.

Today, we are manually moderating comments about once a day.

Comment Edits

Occasionally, comments may be edited by a moderator to remove offensive content. We will say in the post that it was edited. Cuss words will probably be removed or exchanged for #$#%. Keep it clean, please.

Exceptions

We are people and regardless of the statements above, there will be exceptions for posting and not posting. Friends who post can say almost anything.

Typo Blog Code Updated

Posted by JD 01/05/2010 at 15:33

So, I found a few free minutes today and decided to upgrade this blog to the latest release. This was a security related update, seems Typo had a few security vulnerabilities. As usual, things mostly went fine following the instructions provided by the upgrade web page. Mostly.

Overview of the Steps

Solved - Ruby gem update failures

Posted by JohnP 09/27/2009 at 08:08

While updating my ruby development environment this morning, I had a few errors. Google was my friend, as usual.

Issue A

Try a gem system update with

 sudo gem update —system

returned
 ERROR:  While executing gem … (Gem::GemNotFoundException)

The fix was to remove the old gem cache directory (your directory can be found `gem env`)
 sudo rm -rf /var/lib/gems/1.8/source_cache

Issue B

 sudo gem update --system

returned

 undefined method `manage_gems’ for Gem:Module (NoMethodError)

Found this blog entry with the fix.
Basically, I had to
 sudo vi /usr/bin/gem

So the file looks like this

require ‘rubygems’
require ‘rubygems/gem_runner’

  1. Gem.manage_gems

to comment out the old gem.manage line and add a new `required` clause.
Anyway, now yahoofinance-1.2.2.gem is installed and ready for use.

As always, ruby and the packages around it are fun to learn. Lots of extra tools that you’ve never heard of and only use directly once every 6 months.

For example, I wasn’t forcing RubyGems to be used with every small program I wrote. Seems there’s an environment variable that can make that automatic. I haven’t decided whether this was a good idea or not, but here it is:

export RUBYOPT=rubygems 

Added it to my ~/.bashrc. Seems strange that it doesn’t contain a path to the gem area on the file system.

What's Wrong with Perl 1

Posted by JD 09/02/2009 at 10:36

Perl is a “C” like scripting language for those of you who didn’t immediately know or thought I misspelled pearl.