Upgrading application hobo 1.0.1->1.3.0

58 views
Skip to first unread message

Piotr Stepniak

unread,
Jul 1, 2011, 7:32:43 AM7/1/11
to Hobo Users
Hi everyone!

I've been having some major problems with deploying my application on
heroku (it started last month and app has been running since 2006 at
least) and together we found out that there were some issues with read-
only config.

As it became clear that most of advices were not working due to hobo
version I decided to upgrade app to hobo 1.3.0.

So I build new hobo app and started with copying content from old
(models, views, etc.), I tried to figure out which files I can just
copy, which I need to change manually and at the moment I am able to
start WEBrick but it immediately crashes with log pasted below.

My question is - Could you specify what files I cannot overwrite with
those from 1.0.1 version, which I need to modify?
There is some new files/catalogs that didn't exist in my hobo 1.0.1
(rails 2.3.5) version. Are they necessary? Some differ from old
version a lot - which I should pay special attention?

Thank you in advance for support,
Kind regards,
Piotr Stepniak

Below is crash log:
c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:239:in `require': no such file to load
-- action_controller/url_rewriter (LoadError)
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:239:in `require'
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:225:in `load_dependency'
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:596:in `new_constants_in'
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:225:in `load_dependency'
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/dependencies.rb:239:in `require'
from c:/Ruby187/lib/ruby/gems/1.8/gems/sslrequirement-1.2.0/lib/
url_rewriter.rb:1
(...)
from c:/Ruby187/lib/ruby/gems/1.8/gems/sslrequirement-1.2.0/lib/
url_rewriter.rb:1
(...)
from c:/Ruby187/lib/ruby/gems/1.8/gems/sslrequirement-1.2.0/lib/
ssl_requirement.rb:1
(...)
from c:/tmp/backup/1706/new_one/app3/app/controllers/
application_controller.rb:8
(...)
from c:/tmp/backup/1706/new_one/app3/app/controllers/
access_roles_controller.rb:1
(...)
from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/
active_support/core_ext/string/inflections.rb:43:in `constantize'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/hobo/
controller/model.rb:65:in `all_controllers'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/hobo/
controller/model.rb:61:in `each'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/hobo/
controller/model.rb:61:in `all_controllers'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/hobo/
controller/model.rb:58:in `each'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/hobo/
controller/model.rb:58:in `all_controllers'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/generators/
hobo/routes/routes_generator.rb:32:in `controllers_for'
from (erb):11:in `template'
from (erb):6:in `each'
from (erb):6:in `template'
from (eval):1:in `template'
from c:/Ruby187/lib/ruby/gems/1.8/gems/hobo-1.3.0.RC/lib/generators/
hobo/routes/routes_generator.rb:21:in `generate_routes'
(...)

Piotr Stepniak

unread,
Jul 4, 2011, 5:25:54 PM7/4/11
to Hobo Users
Hi again!

I slowly generated each resource and migrate after each one and when
it came to user model I encountered strange problem.

There is method 'method_missing' (below) that throws NoMethodError
Error is located at ' return super' line
You can check stacktrace here: https://gist.github.com/1063958

def method_missing(method, *args, &block)
str = method.to_s
if(str.length < 11)
return super
end
if(str[0,10] == 'calls_week')
week = str[10, str.length - 10].to_i
return super if (week == nil)
return calls_week(week)
end
if(str[0,10] == 'leads_week')
week = str[10, str.length - 10].to_i
return super if (week == nil)
return leads_week(week)
end
if(str[0,10] == 'projs_week')
week = str[10, str.length - 10].to_i
return super if (week == nil)
return projs_week(week)
end
super
end

Do you know why this method was defined like this and how to make it
work with updated gems again?

Thank you in advance!
Piotr Stepniak

Piotr Stepniak

unread,
Jul 5, 2011, 9:08:51 AM7/5/11
to Hobo Users
Hello again!

I moved a little bit forward and previous issues can be considered as
solved..

I have error with Hobo::Controller as app tries to send email.
def forgot_password(user, key)
host = Hobo::Controller.request_host
app_name = Hobo::Controller.app_name || host
@subject = "#{app_name} -- password reset"
@body = { :user => user, :key => key, :host =>
host, :app_name => app_name }
@recipients = user.email_address
@from = "no-reply@#{host}"
@sent_on = Time.now
@headers = {}
end

Before hobo was plugged (/vendor/plugins) and definitions were stored
in controller.rb as
def request_host

Thread.current['Hobo.current_controller'].request.host_with_port
end

def app_name

Thread.current['Hobo.current_controller'].send(:call_tag, :app_name)
end


Do you have idea how to make it work again?

Piotr Stepniak

unread,
Jul 5, 2011, 10:08:48 AM7/5/11
to Hobo Users
Moreover,

How to generate taglibs in hobo 1.3.0 ?
I tried to deploy app on heroku (just to see if it works) and got:
Unexpected error while processing request: No such taglib: /app/app/
views/taglibs {:type=>:include, :src=>"rapid", :template_dir"app/view/
taglibs"} /app/app/views/taglibs/rapid.dryml}

Piotr Stepniak

unread,
Jul 8, 2011, 11:37:46 AM7/8/11
to Hobo Users
I still need some guidance.

To sum up the moment.
1.I have issues with mailer configuration. I moved
def request_host
Thread.current['Hobo.current_controller'].request.host_with_port
end
into user_mailer.rb and I got >> undefined method `request' for
nil:NilClass

2. It seems that hobo doesn't build taglibs on deploy as supposed.

Do you have any idea how to approach this?

dev curmudgeon

unread,
Jul 9, 2011, 4:27:17 PM7/9/11
to Hobo Users
Hi Piotr
wrt your issue 2, you need to commit the autogenerated files in your
git repo and push them to heroku (because they don't get automatically
created on heroku - it's a read-only setup). i'm guessing you made the
wrong choice when running the hobo wizard... so edit your .gitignore
file and remove the following if you have them

-app/views/taglibs/auto/**/*
-config/hobo_routes.rb

btw your app definitely hasn't been running since 2006 :-)
Message has been deleted

dev curmudgeon

unread,
Jul 11, 2011, 6:10:14 PM7/11/11
to Hobo Users
I guess I misunderstood - so you're saying this is broken in your
*development* machine, before you deploy to heroku? that would be
weird.

i suggest you restart this process. create a *new* hobo 1.3 app,
verify it works in development, then deploy it to heroku, verify it
works there. then re-introduce your views, controllers etc.

On Jul 11, 9:18 am, Piotr Stepniak <piotros...@gmail.com> wrote:
> Hi Paul,
>
> I'm glad someone has answered my calls.
> Thank you for suggestions.
> My .gitignore is ok - just: .bundle, db/*.sqlite3, log/*.log, tmp/
> The thing is, when I start application in development mode it does not
> create any files.
> My env configs are deafult.
>
> Every source I checked tells me that it must generate those file
> automatically. But it doesn't.
>
> btw. You are right about years - I checked when hobo 1.0.1 was
> released after I post that.
>
> P.S.
> It seems you created the initial version of this app ;-)

Piotr Stepniak

unread,
Jul 12, 2011, 9:17:24 AM7/12/11
to Hobo Users
Well, I did as you suggested and I added to git repository files: app/
views/taglibs/*

When I pushed it to heroku I got error
!! Unexpected error while processing request: No such taglib: /app/app/
views/taglibs {:template_dir=>"app/views/
taglibs", :type=>:include, :src=>"rapid"} /app/app/views/taglibs/
rapid.dryml

(more stacktrace at: https://gist.github.com/1063958 )

dev curmudgeon

unread,
Jul 13, 2011, 3:58:21 PM7/13/11
to Hobo Users
I don't understand how this ties up with my suggestion...

1) create a *new* hobo 1.3 app (empty, vanilla, no tables)
2) verify it works in development
3) deploy it to heroku
4) verify it works there

did you get that far?

Piotr Stepniak

unread,
Jul 14, 2011, 3:18:23 AM7/14/11
to Hobo Users
Yes.
I did the following:
`hobo new temp_app`
`cd temp_app`
`rails server` //application accessible through browser
`git add` with all files inside app folder
`git commit -a -m "temp_app deploy"`
'git push'
'heroku restart'

with 'heroku logs' I got error description

dev curmudgeon

unread,
Jul 14, 2011, 4:54:58 AM7/14/11
to Hobo Users
nope...you didn't do steps 3 and 4. that will give you a known good
state, then changes in git will show you what the problem is

dev curmudgeon

unread,
Jul 14, 2011, 4:58:10 AM7/14/11
to Hobo Users
what i mean is - get the vanilla app working *on heroku* first. then
start doing the copy etc

Bob Sleys

unread,
Jul 14, 2011, 7:02:47 AM7/14/11
to hobo...@googlegroups.com
If the app works on dev then you have all the files Hobo auto creates on dev.  The issue is they aren't getting moved to Heroku.

As Paul suggested you need to look at your .gitignore and make sure it ISN'T telling git to ignore the Hobo auto generated files.

Bob
Reply all
Reply to author
Forward
0 new messages