[Instantrails-users] RMagick gem problem using InstantRails and possibly WEBrick...

Shane Thomas codejoy at gmail.com
Sat May 20 16:36:12 EDT 2006


Hello, I am new to rails but have been having fun so far.  Until now.  I am
sure this is just my inexperience but I have the RMagick gem (ruby gem for
using imagemagick manipulation) installed on my machine that I would like to
then use in my rails app.  I first installed it and tried it out, and it
didnt do anything for me, took me a while to realize I needed the windows
RUBYOPT rubygems environment variable set.  After that, I could finally call
stuff like:

>ruby myLittleTestProg.rb

which used a
require 'RMagick'
and it would run fine.

So I think, I tested my little script out, I want to do it on rails and call
it from my web app.  I build a skeleton web app, and goto the
config/environment.rb file and say:
require 'RMagick'

adding this line, kills the skeleton app, what ran fine with webrick now
gives me a strange error that I wll post here.  (and yes after changing the
environment.rb file I did relaunch the server).  I installed the flickr gem
as well, and this runs fine, I can easily say in the environment.rb file:
require 'flickr'
and it works, it is just when I require 'RMagick' from that
environment.rbfile in my rails app it crashes with this error in the
index.rhtml:

I am looking for any suggestions, cause I am totally lost.  Not sure why the
RMagick include runs fine when I just use it from a ruby .rb file, but when
I try to require it from my rails app, it doesnt work...this is locally
using WEBrick (i tried my rails host online, and it seems that the require
RMagick works there, I just need to get it working locally for development
and testing purposes..)

Thanks for anyone with any help or suggestions...

-Shane
error is as follows when require 'RMagick' is added to environment.rb of a
skeleton rails app:

SyntaxError in Warhol#index

Showing *app/views/warhol/index.rhtml* where line *#2* raised:

compile error
./script/../config/../app/views/warhol/index.rhtml:2: parse error,
unexpected $, expecting kEND

Extracted source (around line *#2*):

1: <%= form_remote_tag :url => {:action => 'search'}, :update => 'photos' %>
2: 	<fieldset>
3: 		<label for="tags">Tags:</label>
4: 		<%= text_field_tag 'tags' %>
5: 		<%= submit_tag 'Find' %>

Trace of template inclusion: /app/views/warhol/index.rhtml

RAILS_ROOT: ./script/../config/..
 Application Trace <http://localhost:3000/warhol#> | Framework
Trace<http://localhost:3000/warhol#>| Full
Trace <http://localhost:3000/warhol#>

#{RAILS_ROOT}/app/views/warhol/index.rhtml:2:in `compile_template'

 C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:305:in
`compile_and_render_template'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:290:in
`render_template'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:249:in
`render_file'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:699:in
`render_file'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:621:in
`render_with_no_layout'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/layout.rb:243:in
`render_without_benchmark'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:53:in
`render'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:53:in
`render'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:913:in
`perform_action_without_filters'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in
`perform_action_without_benchmark'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in
`perform_action'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
`process_without_filters'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in
`process_without_session_management_support'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in
`process'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in
`dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in
`handle_dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:81:in
`service'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in
`dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59
C:/InstantRails-1.0/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30
C:/InstantRails-1.0/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
script/server:3

 #{RAILS_ROOT}/app/views/warhol/index.rhtml:2:in `compile_template'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:305:in
`compile_and_render_template'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:290:in
`render_template'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:249:in
`render_file'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:699:in
`render_file'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:621:in
`render_with_no_layout'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/layout.rb:243:in
`render_without_benchmark'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:53:in
`render'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:53:in
`render'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:913:in
`perform_action_without_filters'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in
`perform_action_without_benchmark'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in
`perform_action'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
`process_without_filters'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in
`process_without_session_management_support'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in
`process'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in
`dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in
`handle_dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:81:in
`service'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in
`dispatch'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59
C:/InstantRails-1.0/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30
C:/InstantRails-1.0/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
C:/InstantRails-1.0/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
script/server:3

 Request

*Parameters*: None

Show session dump <http://localhost:3000/warhol#>

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


Response *Headers*: {"cookie"=>[], "Cache-Control"=>"no-cache"}


-- 
-Shane
--------------------------
Sites:
Photo
http://www.thomascustomdigital.com
Coding
http://www.viciousbytes.com
fun
http://www.flickr.com/photos/codejoy
blog
http://codejoy.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20060520/2c577b20/attachment-0001.htm 


More information about the Instantrails-users mailing list