Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Admin Admin
RE: Have trouble with Truncate in various pages [ reply ]  
2009-06-29 22:54
Hi Wade,
You are correct. LAC will use the frozen version despite what version you have (if you have rails) on your servers. See this post for more info:
http://support.tigertech.net/freeze-rails

The truncate problem is due to Ruby 1.8.7 used with Rails < 2.2. We use Ruby 1.8.6 and do not get the truncate method error. When we upgrade LAC to Rails 2.2 we will switch to ruby 1.8.7.

You can roll back to 1.8.6 or keep using the patch you found.

Thanks for the info.

By: wade guidry
RE: Have trouble with Truncate in various pages [ reply ]  
2009-06-27 18:55
No, it's Rails 1.2.3.

I did originally have the newer version installed.

Then I did a 'gem uninstall', followed by 'gem install rails -v1.2.3'.

But maybe my issue was caused by the previous install of the newer version.

I was originally confused by whether and which rails to install.

My current understanding is that if you don't install rails, LAC provides its own frozen version. Is that correct?

By: Admin Admin
RE: Have trouble with Truncate in various pages [ reply ]  
2009-06-27 04:50
Hi Wade,
Did you mean Rails 2.2.3?


By: wade guidry
RE: Have trouble with Truncate in various pages [ reply ]  
2009-06-25 16:59
Just FYI, my new LAC install (ruby 1.8.7 and rails 1.2.3) was throwing a truncate error also.

I added some stuff to environment.rb as described here:

http://blog.sviluppoweb.eu/2008/11/26/undefined-method-length-for-enumerableenumerator-on-text_helperrb50in-truncate/

And that seems to have fixed the issue for now.


By: Admin Admin
RE: Have trouble with Truncate in various pages [ reply ]  
2008-12-10 00:05
Hi Tim,
It seems that it may be your ruby/rails set-up. A quick search came up with some blog posts about the truncate method failing under Rails 2.2 and Ruby 1.8.7. You can try to roll back to 2.1.2 or ruby 1.8.6. We are still on Rails 1.2.3 and ruby 1.8.6 so we are not seeing this issue. You can also search some of the forums regarding this issue and probably get a patch to fix it.

Keep in touch and let me know how it goes.

By: Tim Ribaric
Have trouble with Truncate in various pages [ reply ]  
2008-12-09 20:11
Hi,
Having a bit of a problem with a certain function call that crops up in a couple of the pages. The stack trace is:

vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:36:in `truncate'
#{RAILS_ROOT}/app/views/shared/_lib_resource_module.rhtml:8:in `_run_rhtml_47app47views47shared47_lib_resource_module46rhtml'
app/helpers/application_helper.rb:39:in `show_mod'
#{RAILS_ROOT}/app/views/dashboard/my_profile.rhtml:11:in `_run_rhtml_47app47views47dashboard47my_profile46rhtml'

with the following description:
Extracted source (around line #8):

5: <%unless @mod.photo_file_name.nil?%><li><%= image_tag @mod.photo.url(:original), :alt => '' %></li><%end%>
6: <%unless @mod.office_location.blank? and @mod.office_hours.blank? %><li>Office Hours: <br /><%=h @mod.office_location%> <%=h @mod.office_hours%></li><%end%>
7: <%unless @mod.chat_info.blank? and @mod.email.blank? %><li>Contact Info: <br />
8: <%unless @mod.chat_info.blank?%><%=@mod.chat_info%><br /><%end%><%=mail_to @mod.email, truncate(@mod.email,30), :encode => "javascript"%></li><%end%>
9: <%unless @mod.chat_widget.blank?%><li><br /><%= @mod.chat_widget%></li><%end%>
10: </ul>
11: </div>


I'm new to Ruby so I'm not sure if this has to do with environment settings but it appears as though the truncate function is dieing. I'm running:
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
Rails 2.2.2
with Mongrel 1.1.5
all running on an Ubtuntu 8.10 server.

Thanks,
Tim