2013-02-02 110 views
0

在新鲜的rails项目上,我安装了Rails 3.2.11和Ruby 1.9.3-p-194,我还安装了spree版本1.3.1。ActionController :: RoutingError没有路由匹配[GET]

,我在安装所采取的步骤:

rails new mystore 
    cd mystore 
    spree install -A 
    rails s 

一切都没有错误,当我安装,但是当我在http://localhost:3000/产品图片打开它不加载,但大礼包标志被加载。

这是最后的图像,但我得到了相同的所有产品图片:

Started GET "/spree/products/6/small/ror_jr_spaghetti.jpeg" for 127.0.0.1 at 2013-02-02 11:33:54 +0100 

ActionController::RoutingError (No route matches [GET] "/spree/products/6/small/ror_jr_spaghetti.jpeg"): 
    actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' 
    railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app' 
    railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call' 
    activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged' 
    railties (3.2.11) lib/rails/rack/logger.rb:16:in `call' 
    actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call' 
    rack (1.4.4) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.4.4) lib/rack/runtime.rb:17:in `call' 
    activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call' 
    rack (1.4.4) lib/rack/lock.rb:15:in `call' 
    actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call' 
    railties (3.2.11) lib/rails/engine.rb:479:in `call' 
    railties (3.2.11) lib/rails/application.rb:223:in `call' 
    rack (1.4.4) lib/rack/content_length.rb:14:in `call' 
    railties (3.2.11) lib/rails/rack/log_tailer.rb:17:in `call' 
    rack (1.4.4) lib/rack/handler/webrick.rb:59:in `service' 
    /home/vane/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' 
    /home/vane/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' 
    /home/vane/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' 


    Rendered /home/vane/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms) 


Started GET "/assets/favicon.ico" for 127.0.0.1 at 2013-02-02 11:33:54 +0100 
Served asset /favicon.ico - 304 Not Modified (28ms) 
[2013-02-02 11:33:54] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true 

我检查我的版本ImageMagic与identify -version和我:

Version: ImageMagick 6.8.2-2 2013-02-01 Q16 http://www.imagemagick.org 
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC 
Features: DPC OpenMP 
Delegates: fontconfig freetype pango png ps x xml zlib 

我也verifyed说ImageMagick安装正常工作:

/usr/local/bin/convert logo: logo.gif

有人可以告诉我,如果我做错了什么或这是另一个问题。

在此先感谢。

+0

清除数据库('rake db:reset'),然后手动重新生成数据('rake db:seed'),看看是否会引发任何额外的错误或工作。我不知道为什么它不会立即显示图像。 –

+0

'rake db:reset'运行良好,但是当我运行'rake db:seed'时,它弹出这个错误:'loading fixture /home/usr/.rvm/gems/ruby-1.9.3-p194/gems/spree_core -1.3.1/db/default/spree/countries.yml rake中止! SQLite3 :: ConstraintException:PRIMARY KEY必须是唯一的:INSERT INTO“spree_countries”(“name”,“iso3”,“iso”,“iso_name”,“id”,“numcode”)VALUES('Chad','TCD ','TD','CHAD',39,148)' –

回答

0

更好地利用该指南,实际上是:http://guides.spreecommerce.com/getting_started.html

,你应该使用捆绑。我没有看到关于狂热安装的任何内容-a。我认为你应该做一个捆绑exec rails g spree:安装,但我可能是错的。

编辑知道了所有的工作,并向您提交了拉请求。我不确定这个问题到底是什么,但是我所做的所有工作实际上是再次运行spree install,然后让它覆盖之前写的任何内容,而且看起来你错过了更多的依赖关系,再加上我更新你的spree到1.3.2导致1.3.1有错误。我希望这会让你在某个地方。

+0

我遵循指南并使用'bundle exec rails g spree:install'来完成它,但是我得到了同样的错误。 '-A'用于接受所有的默认值。 谢谢你的回答和你的时间。 –

+0

我以前从来没有听说过,无论如何,你是否检查过路线?捆绑exec耙路线和检查?看起来这条路线与您应该拥有的路线不匹配。这是一个默认的产品,用bundle exec rake db:seed加载或者它是如何放入的? – Allen

+0

我有图片'update_positions_admin_product_images /admin/products/:product_id/images/update_positions(.:format)spree/admin/images#update_positions ...'这条路线,但这条路线是为管理面板。我没有任何其他路线包含图像。你认为有可能被列为产品属性吗? –

相关问题