Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Spree 1.1.0 demo on new rails 3.2.3 does not show images #1511

Closed
daniely opened this Issue · 9 comments

2 participants

@daniely

I'm on mac osx, rails 3.2.3, ruby 1.9.3-p194, spree 1.1.0, rvm 1.10.2. ImageMagick was installed using homebrew and is on version 6.7.5-7

First I installed spree gem install spree
Then created new rails project rails new mystore
To install spree to my rails app I did cd mystore and then spree install

The site runs fine but I don't see any images when I run the demo site. I also see that the public/spree/products folder is empty.

@radar
Collaborator

Hey there Daniel,

I am unable to reproduce this on my local machine. Can you show us the full output of spree install?

@daniely

$ spree install
Would you like to install the default gateways? (yes/no) [yes]
Would you like to run the migrations? (yes/no) [yes]
Would you like to load the seed data? (yes/no) [yes]
Would you like to load the sample data? (yes/no) [yes]
Admin Email [spree@example.com]
Admin Password [spree123]
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "."
create config/initializers/spree.rb
create config/spree.yml
remove public/index.html
append public/robots.txt
create app/assets/javascripts/store
create app/assets/javascripts/admin
create app/assets/stylesheets/store
create app/assets/stylesheets/admin
create app/assets/images/store
create app/assets/images/admin
create app/assets/javascripts/store/all.js
create app/assets/javascripts/admin/all.js
create app/assets/stylesheets/store/all.css
create app/assets/stylesheets/admin/all.css
create app/overrides
append config/environment.rb
append db/seeds.rb
copying migrations
creating database
running migrations
loading seed data
loading sample data
insert config/routes.rb


We added the following line to your application's config/routes.rb file:

mount Spree::Core::Engine, :at => '/'

Spree has been installed successfully. You're all ready to go!

Enjoy!
precompiling assets
/Users/Daniel/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/Daniel/.rvm/gems/ruby-1.9.3-p194@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

@radar
Collaborator

Weird, everything there seems fine... Can you upload an image successfully in the admin backend? Does it appear then?

@daniely

This was my first time trying to add a new product. The product gets added fine but when trying to add an image this is the error I got


Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create

/var/folders/H6/H6+r+VUnF0y79tLcq1VRpU+++TI/-Tmp-/stream20120508-66736-1fo4qn6.png is not recognized by the 'identify' command.
Rails.root: /Users/Daniel/src/TestProjects/spree110

Application Trace | Framework Trace | Full Trace
Request

Parameters:

{"utf8"=>"✓",
"authenticity_token"=>"CDlXV0YZ/00pb7KDqm1FPTBOQnKvJj3w6ouN433YghU=",
"image"=>{"attachment"=># @content_type="image/png",
@headers="Content-Disposition: form-data; name=\"image[attachment]\"; filename=\"payment1.png\"\r\nContent-Type: image/png\r\n",
@tempfile=#>,
"alt"=>""},
"product_id"=>"daniel",
"button"=>""}
Show session dump

_csrf_token: "CDlXV0YZ/00pb7KDqm1FPTBOQnKvJj3w6ouN433YghU="
session_id: "8f7fb8415f8a8a19dba1eb9934fbb5fe"
warden.user.user.key: ["Spree::User", [1], "X75BDvNe1TVKQLFk9ah9"]
Show env dump

GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.3"
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"
HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.8"
HTTP_CACHE_CONTROL: "max-age=0"
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "practivate.adobe.com"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"

@radar
Collaborator

Does the identify command work on the command line?

@daniely

Here's what I get

$ identify
dyld: Library not loaded: /usr/local/lib/liblcms2.2.dylib
Referenced from: /usr/local/bin/identify
Reason: image not found
[2] 66867 trace trap identify

@radar
Collaborator

Alright, that looks like your imagemagick installation didn't go too well. I would suggest removing the homebrew version and compiling it from source.

@radar radar closed this
@daniely

Just wanted to let you know you were right, imagemagick wasn't installed correctly.

It looked like imagemagick was installed correctly since homebrew didn't throw any errors but there was something wrong with my homebrew install. Once I fixed homebrew (using brew doctor) then I was able to install imagemagick correctly. After that I created a new project and the images showed up correctly.

My only suggestion at this point would be to throw an error in spree if imagemagick isn't working right. As you saw from my case, it looked like a successful demo install but it wasn't. If you could point me to where I could check for something like that I'd be happy to submit a patch.

Thanks for the help @radar !

@radar
Collaborator

You could probably try calling identify on an image inside the install generator somewhere, as a check before the installation process takes place. I am not sure how you would do this on a Windows computer. Perhaps using some rmagick API?

@daniely daniely referenced this issue from a commit
Daniel verify Image Magick installed (only on Macs)
references #1511
4f363d3
@radar radar referenced this issue from a commit
Daniel verify Image Magick installed (only on Macs)
references #1511

Merges #1533
f727b4a
@radar radar referenced this issue from a commit
Daniel verify Image Magick installed (only on Macs)
references #1511

Merges #1533
078d906
@radar radar referenced this issue from a commit
Daniel verify Image Magick installed (only on Macs)
references #1511

Merges #1533
101d4db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.