Forum: Ruby on Rails Strange question on file_column

Posted by Charlie (Guest)
on 2006-04-17 04:57
I have met a very strange problem on file_column usage.
After I have added
file_column :image

to the model,everything is ok.
But after I added more:
file_column :image, :magick => {:versions => {
                    :thumb => {:size => "50*50"},
                    :medium => {:size => "640*480>"}}}

I can not even start the whole website! Here is the error:
the error has nothing to do with the above. btw: i have installed 
RMagick on the windows platform.  anyone can help me with this strange 
problem? very grateful


 SyntaxError in Demands#index

Showing app/views/demands/list.rhtml where line #13 raised:

compile error
./script/../config/../app/views/demands/list.rhtml:13: Invalid char 
`\002' in expression

Extracted source (around line #13):

10:
11:   <div id="demand-list-body">
12:     <% if !@demands.empty? %>
13:   	  <%= render :partial => 'demand', :collection => @demands, 
:locals => { :hidden => false } %>
14:     <% end %>
15:   </div>
16: </div>

Trace of template inclusion: /app/views/demands/list.rhtml

RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/views/demands/list.rhtml:25:in `compile_template'
#{RAILS_ROOT}/app/controllers/demands_controller.rb:5:in `index'
-e:3

d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:300:in 
`compile_and_render_template'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:285:in 
`render_template'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:244:in 
`render_file'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:697:in 
`render_file'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:619:in 
`render_with_no_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:740:in 
`render_without_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:689:in 
`render_action'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:641:in 
`render_with_no_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/layout.rb:240:in 
`render_without_benchmark'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:53:in 
`render'
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:53:in 
`render'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in 
`perform_action_without_filters'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:355:in 
`perform_action_without_benchmark'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue'
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/rescue.rb:82:in 
`perform_action'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in 
`process_without_filters'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in 
`process_without_session_management_support'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in 
`process'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in 
`dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:115:in 
`handle_dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:81:in 
`service'
d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
d:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
d:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:67:in 
`dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/servers/webrick.rb:59
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/server.rb:30
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in 
`require'
./script/server:3

#{RAILS_ROOT}/app/views/demands/list.rhtml:25:in `compile_template'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:300:in 
`compile_and_render_template'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:285:in 
`render_template'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_view/base.rb:244:in 
`render_file'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:697:in 
`render_file'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:619:in 
`render_with_no_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:740:in 
`render_without_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:689:in 
`render_action'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:641:in 
`render_with_no_layout'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/layout.rb:240:in 
`render_without_benchmark'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:53:in 
`render'
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:53:in 
`render'
#{RAILS_ROOT}/app/controllers/demands_controller.rb:5:in `index'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:908:in 
`perform_action_without_filters'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:355:in 
`perform_action_without_benchmark'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue'
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in 
`perform_action_without_rescue'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/rescue.rb:82:in 
`perform_action'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/base.rb:379:in 
`process_without_filters'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:364:in 
`process_without_session_management_support'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/session_management.rb:117:in 
`process'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/dispatcher.rb:38:in 
`dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:115:in 
`handle_dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:81:in 
`service'
d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
d:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
d:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
d:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/webrick_server.rb:67:in 
`dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/servers/webrick.rb:59
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/commands/server.rb:30
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in 
`require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:136:in 
`require'
./script/server:3
-e:3

Request

Parameters: None

Show session dump

---
flash: !map:ActionController::Flash::FlashHash {}


Response
Headers: {"cookie"=>[], "Content-Type"=>"text/html; charset=utf-8", 
"Cache-Control"=>"no-cache"}
Posted by Michael Guterl (Guest)
on 2006-04-17 05:10
(Received via mailing list)
On 4/16/06, Charlie <blogyingfeng@usa.com> wrote:
>
> I have met a very strange problem on file_column usage.
> After I have added
> file_column :image
>
> to the model,everything is ok.
> But after I added more:
> file_column :image, :magick => {:versions => {
>                     :thumb => {:size => "50*50"},
>                     :medium => {:size => "640*480>"}}}


Shouldn't it be :size => "50x50", and "640x480>" and not * ?


I can not even start the whole website! Here is the error:
Posted by Charlie (Guest)
on 2006-04-17 05:24
I have tried both,and it still can not work.
Further more,i found that if i added

require "RMagick"

to any model class,the above error comes,i think it has something to do 
with the RMaigck install.
I follow the processdure :
gem -install RMagick-win32-1.9.2-mswin32.gem
and run postinstall.rb

anything wrong? ...

Michael Guterl wrote:
> 
> Shouldn't it be :size => "50x50", and "640x480>" and not * ?
> 
> 
> I can not even start the whole website! Here is the error:
Posted by John Tsombakos (Guest)
on 2006-04-17 05:41
(Received via mailing list)
On 4/16/06, Charlie <blogyingfeng@usa.com> wrote:
> I have tried both,and it still can not work.
> Further more,i found that if i added
>
> require "RMagick"
>
> to any model class,the above error comes,i think it has something to do
> with the RMaigck install.

What version of Ruby are you running? There's currently a problem with
Ruby 1.8.4 for Windows and RMagick. See:

<http://rails.techno-weenie.net/question/2006/3/26/how_do_i_get_file_column_plugin_working_on_windows_with_ruby_1_8_4>

jt
Posted by Jeff Coleman (progressions)
on 2006-04-17 05:49
John Tsombakos wrote:
> On 4/16/06, Charlie <blogyingfeng@usa.com> wrote:
>> I have tried both,and it still can not work.
>> Further more,i found that if i added
>>
>> require "RMagick"
>>
>> to any model class,the above error comes,i think it has something to do
>> with the RMaigck install.
> 
> What version of Ruby are you running? There's currently a problem with
> Ruby 1.8.4 for Windows and RMagick. See:
> 
> <http://rails.techno-weenie.net/question/2006/3/26/how_do_i_get_file_column_plugin_working_on_windows_with_ruby_1_8_4>
> 
> jt

You should be able to fix this if you downgrade back to Ruby 1.8.2. 
That's what I did and it has worked for me, after I encountered the same 
problem with file_column, RMagick, and Ruby 1.8.4.

Alternately you can make sure you never ever ever ever type a TAB 
character in an RHTML view... :)

Jeff Coleman
Posted by Charlie (Guest)
on 2006-04-17 07:27
Got it! very grateful!
But I do think it is a stupid bug of RMagick.. And I think I can not 
overwhelm that without your help.Thanks
Charlie

John Tsombakos wrote:
> On 4/16/06, Charlie <blogyingfeng@usa.com> wrote:
>> I have tried both,and it still can not work.
>> Further more,i found that if i added
>>
>> require "RMagick"
>>
>> to any model class,the above error comes,i think it has something to do
>> with the RMaigck install.
> 
> What version of Ruby are you running? There's currently a problem with
> Ruby 1.8.4 for Windows and RMagick. See:
> 
> <http://rails.techno-weenie.net/question/2006/3/26/how_do_i_get_file_column_plugin_working_on_windows_with_ruby_1_8_4>
> 
> jt
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.