Common problems
Firefox is reporting a redirect error (due to infinite loop) during checkout
The problem is likely that your Mongrel does not know about SSL requests. You can verify this easily enough by trying the to hit the root URL of your site using HTTPS in your browser. If you are not successfully redirected to HTTP then this means Rails is unaware of the status of your requests.
Mongrel relies on Apache to tell it which requests are HTTP and which are HTTPS. In the case of the infinite loop, the SslRequirement plugin used by Spree is detecting that the request is not SSL redirecting to HTTPS and still thinking its not SSL. You will need to change the Port 443 configuration of your Apache virtual host (NOTE: Port 443 not Port 80) and add the following line:
RequestHeader set X_FORWARDED_PROTO 'https'
You can read more about this topic (and more on testing SSL locally on your development machine) in Mike Subelsky’s excellent blog post
activate activesupport (= 2.1.0, runtime), already activated
The problem seems to be with the Spree 0.4.1 gem and Rails 2.1.2 (and possibly also Rails 2.1.1). If you have Rails 2.1.2 installed things are not working for some reason (even if you also have Rails 2.1 installed which is what Spree requires.) We’re not sure why that is, but we’ve been able to verify it.
If you want to use Spree 0.4.1 here is your best bet. Uninstall Rails 2.1.2 and all of its 2.1.2 related dependencies (activesupport, actionpack, actionmailer, activerecord, activeresource.) Then your Spree 0.4.1 gem will work fine.
The other option is to keep Rails 2.1.2 installed and just build the edge gem locally on your machine (see building the gem). The latest gem will work with Rails 2.1.2 without any problems (and possibly also Rails 2.1.1 but we haven’t checked.)
NameError when running tests
Problem
NameError in 'Preference by default should not have a definition' "" is not a valid constant name!
Solution
This is a known issue with MySql 5.0.45. Upgrading to a later version of MySql should fix the problem.
Building gem from spree source doesn’t work on Ubuntu Dapper
Problem
When you follow the instructions on Building the gem (Version 1) on Ubuntu Dapper Drake, you might get:
me@machine:/srv/git/gems/spree2$ sudo rake spree:gem:install
(in /srv/git/gems/spree2)
rake aborted!
/srv/git/gems/spree2/app/models/order.rb:34: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'in_progress', :do => lambda {|order| order.update_attribute(:checkout_complete, false)}
^
/srv/git/gems/spree2/app/models/order.rb:35: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'authorized', :do => :complete_order
^
/srv/git/gems/spree2/app/models/order.rb:36: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'paid', :do => lambda {|order| InventoryUnit.sell_units(order)}
^
/srv/git/gems/spree2/app/models/order.rb:37: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'shipped', :do => :mark_shipped
^
/srv/git/gems/spree2/app/models/order.rb:38: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'canceled', :do => :cancel_order
^
/srv/git/gems/spree2/app/models/order.rb:39: parse error, unexpected kDO_BLOCK, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
after_transition :to => 'returned', :do => :restock_inventory
^
/srv/git/gems/spree2/app/models/order.rb:103: parse error, unexpected kDO_BLOCK, expecting kEND
self.line_items.each do |li|
^
/srv/git/gems/spree2/app/models/order.rb:126: parse error, unexpected kDO_BLOCK, expecting kEND
inventory_units.each do |inventory_unit|
^
/srv/git/gems/spree2/app/models/order.rb:129: parse error, unexpected kEND, expecting $
(See full trace by running task with --trace)
It also happens before the db:migrate step.
Solution
Check your Ruby version. Spree does not work with Ruby 1.8.4.
You should upgrade to Ruby 1.8.6, maybe this helps: http://wiki.brightbox.co.uk/docs:ruby:1.8.6
Building gem from spree source doesn’t work
Problem
Tests pass, but at the end of the build you get
[...] spree-0.3.0/vendor/plugins/state_machine/test/unit/machine_test.rb spree-0.3.0/vendor/plugins/state_machine/test/unit/state_machine_test.rb spree-0.3.0/vendor/plugins/state_machine/test/unit/transition_test.rb spree-0.3.0/tmp/ cd - cd pkg rake aborted! Command failed with status (127): [zip -r spree-0.3.0.zip spree-0.3.0...]
Solution
Check your permissions and make sure zip is installed.
Right click problem on taxonomy screens
Problem
Right-click does not work on the taxonomy admin screen
Solution
This is a known issue with Spree and certain versions of Opera. It only affects admin users so it is not considered a major issue. Use another browser instead.