Having trouble updating rails?

I was setting up the AAB dev environment on my macbook pro when I realized that I was only running Rails 2.0.2 but AAB wanted 2.1.0.  Ehh...  no big deal I thought.  I opened up Terminal and typed...

$ sudo gem update rails

All the usual output scrolled by, indicating that everything went as expected.  Once it was done I tried to check the rails version and that's when I realized that there was a problem

$ rails -v
/Library/Ruby/Site/1.8/rubygems.rb:377:in `report_activate_error':
RubyGem version error: activesupport(2.0.2 not = 2.1.0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:309:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:335:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:334:in `each'
from /Library/Ruby/Site/1.8/rubygems.rb:334:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:76:in
`active_gem_with_options'
from /Library/Ruby/Site/1.8/rubygems.rb:50:in `gem'
from /Library/Ruby/bin/rails:15

So then I ran 'gem list' and saw what was up.

...
actionmailer (2.0.2, 1.3.6, 1.3.3, 1.2.5)
actionpack (2.0.2, 1.13.6, 1.13.3)
actionwebservice (1.2.6, 1.2.3, 1.1.6)
activemerchant (1.1.0)
activerecord (2.0.2, 1.15.6, 1.15.3)
activeresource (2.0.2)
activesupport (2.0.2, 1.4.4, 1.4.2)
...

When I did the rails update, none of the rails dependencies were updated.  I tried the update again, thinking that maybe something had just choked in the process, but it was no luck.  A quick Google search yielded the solution of using update with the --source option and http://gems.rubyonrails.org as the URL.

$ sudo gem update --source http://gems.rubyonrails.org
Updating installed gems
Updating metadata for 13 gems from http://gems.rubyonrails.org/
.............
complete
Updating actionmailer
Updating metadata for 13 gems from http://gems.rubyonrails.org/
.............
complete
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Updating activerecord
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activerecord-2.1.0
Updating activeresource
Successfully installed activesupport-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activerecord-2.1.0
Successfully installed activeresource-2.1.0
Gems updated: activesupport, actionpack, actionmailer, activesupport, actionpack, actionmailer, activerecord, activesupport, actionpack, actionmailer, activerecord, activeresource

That did it! Now rails and all its dependencies are at 2.1.0.

Posted 20 days ago with 2 comments so far...
Tagged as:  rails  rubygems  2.1.0 

my first hiccup

So I mentioned earlier that I was using Capistrano 2.0.  Well, in actuality, I was using version 2.3.0.  Why's this important?  Well, I'll tell ya....

On my initial deploy:

cap deploy:cold

...everything went fine.  Capistrano did a clone of my Github repo, ran all of my migrations, and started up the mongrels without a hitch.  It was on my subsequent deploy that I had a problem.

macbook:blog brent$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
ssh_exchange_identification: Connection closed by remote host
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/brent/public_html/acts-as-blogr.com/releases/20080604051355; true"
    servers: ["acts-as-blogr.com"]
    [acts-as-blogr.com] executing command
    command finished
/Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/git.rb:217:in `query_revision': Unable to resolve revision for master (RuntimeError)
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `send'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy.rb:37:in `load'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:87:in `call'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:87:in `fetch'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:110:in `protect'
     ... 35 levels...
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/bin/cap:4
    from /usr/bin/cap:19:in `load'
    from /usr/bin/cap:19

I tried again and got the same results.  After a quick google or two, I found this Lighthouse ticket for Capistrano. Evidently there's an issue with cap version 2.3.0 in which it calls 'fetch --tags' to update your code, which returns only tag commits instead of all commits.  This is a problem.

Fortunately, the solution is a simple as either downgrading to version 2.2.0, or upgrading to the latest build.  I opted for the safe route and installed 2.2.0.  Now everything is right as rain. 

Posted about 1 month ago with 2 comments so far...
Tagged as:  capistrano  git 

the deed is done...

Acts-As-Blogr v2.0 is up and running!

I ended up going with Nginx and a 2 mongrel cluster, and deployed it all via Capistrano 2.0 which thankfully has Git support.

I still need to get all the data migrated over from the old version.  I think I may just re-enter the old posts by hand since there was only a handful.  I also need to get all my links and whatnot setup.

AAB 2.0 is still a little bit lacking.  I could've waited longer, but I figured once I had the bare minimum features, that I'd go ahead and deploy it.

Most of the new features aren't really visible from the public-facing side.  I think once I add a few more features, I'll make a little screencast to show it all off.

Anyway, it looks like I've got some work to do... 

Posted about 1 month ago...
Tagged as:  v2.0  nginx  capistrano  git 

where've I been?

In case you haven't noticed, I haven't posted anything for quite a while.  I've been a little hesitant to post anything new since I'm planning to upgrade Acts-As-Blogr very soon.  I've been slowly rewriting the entire application, little by little, over the past month.

This new version version will include several much needed features that the initial version is lacking, including spam protection and comment notification.  I would have just expanded upon the existing code base, but I decided to move it over to a restful architecture, using Rails 2.0.  I'm also working on improving the look and feel by cleaning up the css, adding in a sprinkling of ajax goodness, and a few other things like gravatars and such.

Whenever the upgrade happens, things will likely be down for at least a day or so since I'm planning to completely wipe my slice and start from scratch. Inevitably, there'll be a few headaches and bumps in the road as I rebuild the server.  I'll probably go the deprec/capistrano route, but I may also play with the new mod_rails.

So, there you have it.  That's what I've been up to.  Check back soon!

* UPDATE *

It's done, in case you couldn't tell by the following posts... 

Posted about 1 month ago with 1 comment so far...
Tagged as:  v2.0 

Git really 'gits' around...

I said 'gits' instead of 'gets'.  Get it?  Or should I say 'Git it'?  Ok, enough bad jokes...

If you're reading this, I'm sure you're aware of Git.  (Or you're a relative of mine, and you're still wondering what 'acts-as-blogr' means...)  If you're not, then climb out from under your rock, point your browser to the Git homepage, and start reading

Git is the latest trend in version control.  All the cool(aid) kids are drinking it, I mean using it.  Lately, it seems as though on every blog I read, and at every meet I attend, someone's preaching about Git.  See my little psuedo-rant here.  Since I'm not usually an early adopter, I usually wait a little while before picking up some new (or recently popular) technology.  Well, it looks like that time has come.

I started a new project last week and didn't like that my Subversion repo was on the same box as the app.  If something were to happen to that machine, I'd lose everything.  I looked around at several SVN hosting sites, but nothing really tickled my fancy.  I had a Github account which I hadn't taken advantage of yet, so I figured why not make the switch over to Git.

Funny thing was, just the day before I was bustin Brendan's balls for preaching about Git, telling him he was 'drinkin the kool-aid'.  To be honest though, I don't think anyone that does Rails development for a living can say anything about drinking the kool-aid.  Hell, we're swimming in it...

So, I've been using Git for a couple of days now and the transition hasn't been too painful.  I had a few small issues, like where I couldn't push to the master repo due to some config issue, and when I had forgotten to setup my public key on Github.  Aside from that, the only real trouble is getting used to the different terminology.

I definitely like the speed and ease in which you can create branches with Git.  I attempt a lot of different things with my blog, most of which never get deployed, and its nice to be able to easily create a branch and experiment without worrying about hosing the code in Trunk.

Anyway, enough about me...

Picture_2

So, I noticed that Heroku has added Git integration.  Check out the demo here.  I've played with Heroku for a while, and I must say that I really like it.  I do very little development via their interface, but its really nice to have a way to quickly deploy an app and have it publicly available with virtually no hassle involved.  Currently, Heroku acts as a staging server for a couple of personal projects that I'm working on.  If you haven't tried it out yet, you should definitely do so.

Picture_3

There's also Lighthouse, a ticket-tracking and project management app written in Rails. While it doesn't currently support Git integration, from what I hear, they're planning to with the 2.0 release.  I haven't used Lighthouse much yet, but I know of some projects that recently made the move from Unfuddle over to Lighthouse in anticipation of the Git integration.

It looks like Git is taking over, and for good reason.  So, if you're like me and you have some aversion to jumping on the bandwagon, then get over yourself and go give it a try.  You just might enjoy the ride...

Posted 3 months ago with 3 comments so far...
Tagged as:  git  heroku  lighthouse  unfuddle