Problems migrating to CE v1.0.2

2 views
Skip to first unread message

Alejandro

unread,
Jun 16, 2009, 11:59:41 PM6/16/09
to CommunityEngine
Hi,

I'm trying to migrate to CE v1.0.2 and I'm having some problems.

1) Translations like :looking_for_most_x.l :link => link_to("#
{:recent.l}?", recent_path) are not working, it shows "¿Buscando lo
más {link}? "

I've tried in the console I18n.t :looking_for_most_x.l, :link =>'kk'
and it works fine

2) When a mail is being sent, I have this error:

TypeError (superclass mismatch for class UserNotifier):
app/models/user_notifier.rb:1
desert (0.5.0) lib/desert/rails/dependencies.rb:67:in
`define_constant_from_file'
desert (0.5.0) lib/desert/rails/dependencies.rb:66:in `each'
desert (0.5.0) lib/desert/rails/dependencies.rb:66:in
`define_constant_from_file'
desert (0.5.0) lib/desert/rails/dependencies.rb:45:in
`define_constant_with_desert_loading'
desert (0.5.0) lib/desert/rails/dependencies.rb:8:in
`load_missing_constant'
/var/lib/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in
`const_missing'
desert (0.5.0) lib/desert/rails/dependencies.rb:54:in
`look_for_constant_in_parent_module'
desert (0.5.0) lib/desert/rails/dependencies.rb:13:in
`load_missin....

I'm using ARMailer

3) In forums/recent:

forum_url failed to generate from
{:controller=>"forums", :id=>nil, :action=>"show"}, expected:
{:controller=>"forums", :action=>"show"}, diff: {:id=>nil}

Extracted source (around line #49):

46: = pluralize @users[post.user_id].sb_posts_count,
'post'
47: %td.body.entry-content
48: %p.topic
49: = link_to(h(post.forum_name), forum_path(post.forum))
50: \/
51: = link_to h(post.topic_title), forum_topic_path
(post.forum, post.topic)
52: = post.body_html

4) When I run rake community_engine:test, I get this error:

/usr/bin/ruby1.8 -I"lib:lib" "/var/lib/gems/1.8/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb" "vendor/plugins/community_engine/test/
functional/posts_controller_test.rb" "vendor/plugins/community_engine/
test/functional/tags_controller_test.rb" "vendor/plugins/
community_engine/test/functional/moderators_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
sessions_controller_test.rb" "vendor/plugins/community_engine/test/
functional/activities_controller_test.rb" "vendor/plugins/
community_engine/test/functional/statistics_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
favorites_controller_test.rb" "vendor/plugins/community_engine/test/
functional/homepage_features_controller_test.rb" "vendor/plugins/
community_engine/test/functional/forums_controller_test.rb" "vendor/
plugins/community_engine/test/functional/theme_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
skills_controller_test.rb" "vendor/plugins/community_engine/test/
functional/offerings_controller_test.rb" "vendor/plugins/
community_engine/test/functional/sb_posts_controller_test.rb" "vendor/
plugins/community_engine/test/functional/
categories_controller_test.rb" "vendor/plugins/community_engine/test/
functional/comments_controller_test.rb" "vendor/plugins/
community_engine/test/functional/clippings_controller_test.rb" "vendor/
plugins/community_engine/test/functional/votes_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
photos_controller_test.rb" "vendor/plugins/community_engine/test/
functional/monitorships_controller_test.rb" "vendor/plugins/
community_engine/test/functional/base_controller_test.rb" "vendor/
plugins/community_engine/test/functional/ads_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
events_controller_test.rb" "vendor/plugins/community_engine/test/
functional/invitations_controller_test.rb" "vendor/plugins/
community_engine/test/functional/contests_controller_test.rb" "vendor/
plugins/community_engine/test/functional/admin_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
users_controller_test.rb" "vendor/plugins/community_engine/test/
functional/friendships_controller_test.rb" "vendor/plugins/
community_engine/test/functional/sitemap_controller_test.rb" "vendor/
plugins/community_engine/test/functional/topics_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
metro_areas_controller_test.rb" "vendor/plugins/community_engine/test/
unit/friendship_test.rb" "vendor/plugins/community_engine/test/unit/
asset_test.rb" "vendor/plugins/community_engine/test/unit/
state_test.rb" "vendor/plugins/community_engine/test/unit/
event_test.rb" "vendor/plugins/community_engine/test/unit/
topic_test.rb" "vendor/plugins/community_engine/test/unit/
category_test.rb" "vendor/plugins/community_engine/test/unit/
clipping_image_test.rb" "vendor/plugins/community_engine/test/unit/
sb_post_test.rb" "vendor/plugins/community_engine/test/unit/
ad_test.rb" "vendor/plugins/community_engine/test/unit/
contest_test.rb" "vendor/plugins/community_engine/test/unit/
favorite_test.rb" "vendor/plugins/community_engine/test/unit/
photo_test.rb" "vendor/plugins/community_engine/test/unit/
choice_test.rb" "vendor/plugins/community_engine/test/unit/
comment_test.rb" "vendor/plugins/community_engine/test/unit/
message_test.rb" "vendor/plugins/community_engine/test/unit/
skill_test.rb" "vendor/plugins/community_engine/test/unit/
clipping_test.rb" "vendor/plugins/community_engine/test/unit/
country_test.rb" "vendor/plugins/community_engine/test/unit/
post_test.rb" "vendor/plugins/community_engine/test/unit/poll_test.rb"
"vendor/plugins/community_engine/test/unit/offering_test.rb" "vendor/
plugins/community_engine/test/unit/homepage_feature_test.rb" "vendor/
plugins/community_engine/test/unit/friendship_status_test.rb" "vendor/
plugins/community_engine/test/unit/forum_test.rb" "vendor/plugins/
community_engine/test/unit/invitation_test.rb" "vendor/plugins/
community_engine/test/unit/vote_test.rb" "vendor/plugins/
community_engine/test/unit/moderatorship_test.rb" "vendor/plugins/
community_engine/test/unit/user_notifier_test.rb" "vendor/plugins/
community_engine/test/unit/user_test.rb" "vendor/plugins/
community_engine/test/unit/metro_area_test.rb" "vendor/plugins/
community_engine/test/unit/monitorships_test.rb"
/var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/rails/dependencies.rb:
15:in `load_missing_constant': Constant APP_URL from app_url.rb not
found (NameError)
from /home/alejandro/.gem/ruby/1.8/gems/activesupport-2.3.2/
lib/active_support/dependencies.rb:80:in
`const_missing_not_from_s3_library'
from /var/lib/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/
extensions.rb:206:in `const_missing'
from /home/alejandro/.gem/ruby/1.8/gems/activesupport-2.3.2/
lib/active_support/dependencies.rb:92:in `const_missing'
from /home/alejandro/.gem/ruby/1.8/gems/activesupport-2.3.2/
lib/active_support/dependencies.rb:98:in `send'
from /home/alejandro/.gem/ruby/1.8/gems/activesupport-2.3.2/
lib/active_support/dependencies.rb:98:in `const_missing'
from /home/alejandro/workspaces/Mio/Rails/social_network/
vendor/plugins/community_engine/app/models/user_notifier.rb:7
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from /home/alejandro/.gem/ruby/1.8/gems/activesupport-2.3.2/
lib/active_support/dependencies.rb:158:in `require_without_desert'
from /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/ruby/
object.rb:8:in `require'
from /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/ruby/
object.rb:32:in `__each_matching_file'
from /var/lib/gems/1.8/gems/desert-0.5.0/lib/desert/ruby/
object.rb:7:in `require'

I probably have more errors, but I'm done for today :)

Thanks

moritz

unread,
Jun 17, 2009, 4:48:18 PM6/17/09
to CommunityEngine
Did you add APP_URL to your environment(s)?

7. Modify each environment file (development.rb, test.rb, and
production.rb) as indicated below:

# development.rb, production.rb, and test.rb should include something
like:
APP_URL = "http://localhost:3000" (or whatever your URL will be for
that particular environment)

Alejandro

unread,
Jun 17, 2009, 9:31:57 PM6/17/09
to CommunityEngine
yup, that was already done this way, remember I'm upgrading.
Thanks!

Bruno Bornsztein

unread,
Jun 22, 2009, 1:35:25 PM6/22/09
to communi...@googlegroups.com

1) Translations like :looking_for_most_x.l :link => link_to("#
{:recent.l}?", recent_path) are not working, it shows "¿Buscando lo
más {link}? "

Check your language file. Translations with tokens should be of the form:   
   about_site: "About {{site}}"
 
(Note the double curly braces)


2) When a mail is being sent, I have this error:

TypeError (superclass mismatch for class UserNotifier):
 app/models/user_notifier.rb:1
 desert (0.5.0) lib/desert/rails/dependencies.rb:67:in
`define_constant_from_file'
 desert (0.5.0) lib/desert/rails/dependencies.rb:66:in `each'
 desert (0.5.0) lib/desert/rails/dependencies.rb:66:in
`define_constant_from_file'
 desert (0.5.0) lib/desert/rails/dependencies.rb:45:in
`define_constant_with_desert_loading'
 desert (0.5.0) lib/desert/rails/dependencies.rb:8:in
`load_missing_constant'
 /var/lib/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in
`const_missing'
 desert (0.5.0) lib/desert/rails/dependencies.rb:54:in
`look_for_constant_in_parent_module'
 desert (0.5.0) lib/desert/rails/dependencies.rb:13:in
`load_missin....

I'm using ARMailer

I seem to remember something about AR mailer requiring your notifier class to inherit from ARMailer instead of ActionMailer::Base. Are you overriding the UserNotifer class in your app? If so, are you having it inherit from ARMailer? If so, you'll get a superclass mismatch. I don't know if there's anyway to override a class and change it's parent class dynamically (might have to ask someone with better Ruby skills than me). 

 

3) In forums/recent:

forum_url failed to generate from
{:controller=>"forums", :id=>nil, :action=>"show"}, expected:
{:controller=>"forums", :action=>"show"}, diff: {:id=>nil}

Extracted source (around line #49):

46:             = pluralize @users[post.user_id].sb_posts_count,
'post'
47:         %td.body.entry-content
48:           %p.topic
49:             = link_to(h(post.forum_name), forum_path(post.forum))
50:             \/
51:             = link_to h(post.topic_title), forum_topic_path
(post.forum, post.topic)
52:           = post.body_html

Maybe you have a SbPost without an associate Forum object somehow? Looks like url_for is trying to call post.forum, and getting nil, so your forum_url has no forum.id or forum.to_param to use when generating the route.
 

4) When I run rake community_engine:test, I get this error:

/usr/bin/ruby1.8 -I"lib:lib" "/var/lib/gems/1.8/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb" "vendor/plugins/community_engine/test/
functional/posts_controller_test.rb" "vendor/plugins/community_engine/
test/functional/tags_controller_test.rb" "vendor/plugins/
community_engine/test/functional/moderators_controller_test.rb"
"vendor/plugins/community_engine/test/functional/
sessions_controller_test.rb" "vendor/plugins/community_engine/test/
functional/activities_controller_test.rb" "vendor/plugins/
community_engine/test/functional/statistics_controller_test.rb"
"vendor/plugins/community_engine/test/functional/ /.....

Woah. That just indicates to me that something's wrong with your setup. Maybe something is calling APP_URL before it has been set, so Desert tries to look for a file where that constant is defined, but finds none.

Alejandro

unread,
Jun 28, 2009, 6:58:13 PM6/28/09
to CommunityEngine
Thanks for the help Bruno, I'm still trying to migrate.

I'm getting this error now:

Showing vendor/plugins/community_engine/app/views/polls/
_excerpt.html.haml where line #4 raised:

stack level too deep

Extracted source (around line #4):

1: .poll_excerpt
2: =image_tag 'icons/poll.png', :plugin => 'community_engine'
3: = poll.question
4: = link_to :vote_now.l, new_vote_path(:post_id => poll.post.id),
{:title => 'Log in to vote', :class => 'vote'}

I don't have a clue why it's happening...

One question: is there any way to run my migrations on the test db?

Thanks!

On Jun 22, 2:35 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:

Bruno Bornsztein

unread,
Jun 29, 2009, 8:59:27 PM6/29/09
to communi...@googlegroups.com
Hi Alejandro,
Sorry, that error is new to me; don't know what it comes from. 
 


One question: is there any way to run my migrations on the test db?

Sure, you can run rake db:migrate RAILS_ENV=test

Thanks,
Bruno

Alejandro

unread,
Jul 14, 2009, 11:07:24 AM7/14/09
to CommunityEngine
Sorry for bothering again, when I run rake db:migrate RAILS_ENV=test
I get this:

[COMMUNITY ENGINE] You have 3 pending CommunityEngine migrations:
CE is at 62, but you have only migrated it to 59
Please run 'script/generate plugin_migration' AND 'rake db:migrate'
before continuing, or you will experience errors.
---
** Execute db:migrate
== CommunityEngineToVersion57: migrating
=====================================
rake aborted!
An error has occurred, this and all later migrations canceled:

Constant Engines from engines.rb not found

Any ideas?

Thanks

On Jun 29, 9:59 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> Hi Alejandro,Sorry, that error is new to me; don't know what it comes from.

Alejandro

unread,
Jul 14, 2009, 1:50:18 PM7/14/09
to CommunityEngine
Another error:

Showing vendor/plugins/community_engine/app/views/photos/
new.html.haml where line #59 raised:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym

Extracted source (around line #59):

56: var uploader;
57: window.onload = function (){
58: - session_key = ActionController::Base.session_options
[:key]
59: ="uploader = new CommunityEngine.SwfUpload('#
{swfupload_user_photos_path(:user_id => current_user.id, session_key
=> cookies[session_key], request_forgery_protection_token =>
form_authenticity_token)}');"
60: };
61:
62: %div{:style=>"margin: 0px 10px;"}

Bruno Bornsztein

unread,
Jul 14, 2009, 3:12:55 PM7/14/09
to communi...@googlegroups.com
You need to update your environment.rb as indicated in the UPGRADING.markdown document (change 
config.action_controller.session = {
    :session_key

to

config.action_controller.session = {
    :key

Alejandro

unread,
Jul 14, 2009, 4:32:21 PM7/14/09
to CommunityEngine
thanks Bruno, and the other error?

rake db:migrate RAILS_ENV=test
I get this:

[COMMUNITY ENGINE] You have 3 pending CommunityEngine migrations:
CE is at 62, but you have only migrated it to 59
Please run 'script/generate plugin_migration' AND 'rake db:migrate'
before continuing, or you will experience errors.
---
** Execute db:migrate
== CommunityEngineToVersion57: migrating
=====================================
rake aborted!
An error has occurred, this and all later migrations canceled:

Constant Engines from engines.rb not found

Any ideas?

Thanks

On Jul 14, 4:12 pm, Bruno Bornsztein <bruno.bornszt...@gmail.com>
wrote:
> You need to update your environment.rb as indicated in the
> UPGRADING.markdown document (change config.action_controller.session = {
>  :session_key
>
> to
>
> config.action_controller.session = {
>     :key
>
Reply all
Reply to author
Forward
0 new messages