Spree is a complete open source e-commerce solution for Ruby on Rails. Ecommerce Storefront and Platform Solutions | Spree Commerce

Spree - i18n gem issue

I got a problem with a new version of spree gem (branch: '2-3-stable'). When i try to install it, I receive this error.

my_store$ rails server
The git source https://github.com/spree/spree_gateway.git is not yet checked out. Please  run `bundle install` before trying to start your application

my_store$ bundle install
Bundler could not find compatible versions for gem "i18n":
 In Gemfile:
  spree (= 2.3.1) ruby depends on
   spree_core (= 2.3.1) ruby depends on
    i18n (= 0.6.9) ruby

 rails (= 4.1.2) ruby depends on
  activesupport (= 4.1.2) ruby depends on
    i18n (0.6.11)

But according to gem list i got both of this gems installed i18n (0.6.11, 0.6.9). Can someone help me to fix this problem

Source: (StackOverflow)

Upgrade spree to 1.0.0

I'm trying to upgrade Spree from 0.7.0 to 1.0.0, I added in my gemfile

gem 'spree', '1.0.0'

and mounted the routes by adding this in routes.rb

Store::Application.routes.draw do
  mount Spree::Core::Engine, :at => "/"

after that I had override some controllers and model and I added the namespace Spree:: in this way

Spree::ProductsController.class_eval do

now I'm stuck on this error

Mysql2::Error: Table 'store_development.spree_product_groups' doesn't exist: SHOW FIELDS FROM `spree_product_groups`

and it is totally right cause the table does not exists, but it is named without the spree_ prefix, how can i quickly fix it? I suppose that some new column or table has been added to the database, how can i check this? Is there a procedure to upgrade safely spree?

Source: (StackOverflow)

Running Rails in Rubymine from subproject

I'm using RubyMine 3.1.1 with Rails 3.0.9.

I have the Spree project cloned from Github, and I want to debug the server while working on the code. To do this, Spree includes a sandbox rake command that creates a subfolder (called sandbox) that contains an instance of the rails app, one that refers to the parent directory containing the source as its spree gem.

If I close the original project and open the sandbox subfolder as a new probect, I get the correct run configurations for development and production and I can successfully debug. However, this doesn't let me edit the spree code in the parent directory.

If I'm in the parent directory, the subfolder is there of course, but there's no rails run configurations and you can't add one as it says there is no rails server launcher in the project (or some facsimile of that message).

Anyone know how to make RubyMine recognize the run configurations for a subfolder?

Source: (StackOverflow)

Integrating Payment Gateway (activemerchant based) with spree

I am trying to integrate payu.in payment gateway into my rails app. I have integrated their gem in the application but when i go to


I am not able to see the payment gateway under the provider options.

I have followed the steps as prescribed in http://guides.spreecommerce.com/payment_gateways.html

My app/models/spree/gateway/payu.rb looks like this:

module Spree
  class Gateway::Payu < Gateway
    def provider_class

Source: (StackOverflow)

Registering a custom Spree Calculator not working

Following the docs on this page... http://guides.spreecommerce.com/developer/calculators.html

I've created a class in models/spree/calculators/

module Spree 
class Calculator::ZipTax <  Calculator
  def self.description
  "Calculates Tax Rates From Zipcode in TaxRates Table"
    def compute(computable)
  case computable
    when Spree::Order
    when Spree::LineItem
    def compute_order(order)
    zipcode = order.bill_address.zipcode[0,5]
    zip = TaxTable.where(:zipcode => zipcode).first
      rate = zip.combined_rate
        order.line_items.sum(&:total) * rate


And in initializers/spree.rb I've added:

config = Rails.application.config
config.spree.calculators.tax_rates << Spree::Calculator::ZipTax

But I can not get Rails to start. I get undefined method `<<' for nil:NilClass (NoMethodError) on the initializer/spree.rb file.

How do I register a custom Calculator? Using Spree 1.3.2.

Source: (StackOverflow)

Extend spree to have functionalities as Shopify?

I'm new to spree. I'm not sure whether is that possible to extend spree to have a functionality like Shopify. The user signups to create a store. He owns everything to that store. Each owner is not able to edit other stores.

How can I extend it? Which is the best strategy?

  • through database sharding, each store has it own database, connect to different based on domain name?

  • add store_id to every table, that would need to change a lot of code, right?

Any ideas?

Source: (StackOverflow)

Best way to customize Spree?

I need to modify Spree (functionality and views). But Spree installs as a gem (it's not simple application), I believe it's actually a Rails engine right? I'm pretty new at all of this.

But what is exactly the best way to grab Spree and customize it entirely to create your own ecommerce solution?

Thank you.

PS: Using Ruby 1.8.7 and Rails 3.

Source: (StackOverflow)

Connection refused - connect(2) (Errno::ECONNREFUSED)

I am developing a spree application ,I recently removed and reinstalled ruby 1.9.3, now whenever I try rails s on terminal I get the following error :

/home/swapnil/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)

Source: (StackOverflow)

Extending the Spree::Product model/class

I'm using Spree in a Rails 3.2 app of mine and I want to extend Spree's Product class to better suit my needs as for example to establish a relationship with another model in my app. What's the best way to do this? I could not find anything about it in the project documentation

And what if I want to add new attributes/fields to the Product resource? I can't find it's migration either :/

Thanks in advance :)

Source: (StackOverflow)

Big Decimal Stored as 60.00, Returns as 0.0?

I am customizing a Spree 2.3 application in Rails 4. When I save a price.amount, it appears to save correctly in the database, but when I retrieve it, it is wrapped in the BigDecimal class and returns 0.

How can I store, or retrieve, the correct value?

# in the form
<%= number_field_tag :amount %>

# controller action
@variant.price = params[:amount]

# appears in PostgresQL database as type 'numeric'
id: 35, amount: 60.00

# retrieved in Rails console as BigDecimal class instance
# looks like the wrong amount
2.1.1 :001 > Spree::Price.find_by_id(35).amount
=> #<BigDecimal:105806d20,'0.0',9(27)>

# converts to 0.0
2.1.1 :002 > Spree::Price.find_by_id(35).amount.to_f
=> 0.0

# testing data retrieval in the console
2.1.1 :003 > ActiveRecord::Base.connection.execute("SELECT * FROM spree_prices WHERE id=35").first
=> {"id"=>"35", "variant_id"=>"35", "amount"=>"60.00", "currency"=>"USD", "deleted_at"=>nil} 
2.1.1 :004 > Spree::Price.find(35)
=>  #<Spree::Price id: 35, variant_id: 35, amount: #<BigDecimal:109ec4a28,'0.0',9(27)>, currency: "USD", deleted_at: nil>

Source: (StackOverflow)

what's the most extensible/flexible FOSS e-commerce software? (or should I roll-my-own?)

I need to build an internal order entry and tracking system for a grocery store which requires many of the features of existing e-commerce systems, such as product catalog, customer_to_order relations/views, movement reporting, order statuses, etc. However, the first phase of the product is purely internal, so I don't need any online e-commerce features such as shipping addresses, postal rates or a payment gateway. I've also got a bunch of business specific stuff that may not apply to a lot of on-line stores: complex product/customer discount system, lots of attributes for the products, a producer order-tracking flow (customer has an order with us and we have an order with the producer), and so on.

So I'm stuck wondering if I would be better off customizing an existing product, or rolling my own with a good web framework (such as Python/web2py)? If it was a cut-and-dry online store, then the decision would be clear - but it's not. So I'm trying to find the most extensible/flexible FOSS e-commerce software for prototyping.

The main contenders I've been considering so far are: Drupal/Ubercart, Django/Satchmo and RoR/Spree. Ubercart is undergoing a complete re-write as Drupal Commerce, so that puts me off. The Spree project looks clean and I like the ideas - but I'm already writing a product/customer ETL in Jython and don't want to balance the two languages - both Python and Ruby are new to me.

I don't like Magento's enterprise/community edition model. And I've heard lots of complaints about osCommerce and it's variants.

Thanks in advance for your thoughts.

By the way, I think the gap between the feature-set I need and what I could get out-of-the-box from an existing e-commerce product is on the order of 30%.

Source: (StackOverflow)

Bundle Install passes with no errors, but on visiting the site, I see an Error

If I run bundle install, the application passes, everything is properly installed.

But if I reboot nginx, and visit the site, I see the Passenger Error message.

Ruby (Rack) application could not be started

Error message:
   http://github.com/railsdog/spree.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)

Exception class:

Application root:

I also found out this :

If I do a bundle show spree, It returns :


but any of the other gems are here at:

/home/shadyfront/webapps/rails/gems/gems/ what does that mean? 

Anyone know why this might be?


source 'http://rubygems.org'

gem 'rails', '3.0.3'
gem 'spree', '0.5.99', :git => 'http://github.com/spree/spree.git' 
gem 'haml'
gem 'ruby-debug'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'ckeditor', '3.4.2.pre'
# aged_revolt gem is a local gem that is generated with Spree extensions
gem "aged_revolt", :require => "aged_revolt", :path => "aged_revolt"
# this is a gem i downloaded and messed with locally
gem "spree_easy_contact", '1.0.2', :path => "#{File.expand_path(__FILE__)}/../vendor/gems/spree_easy_contact-1.0.2"
gem "honeypot-captcha"

Source: (StackOverflow)

Spree search filter for properties and variants

I'm running Spree 1.3.1 and I'm trying to customize the Taxon show page.

I would like it to return the products contained inside the current Taxon, eventually filtered by a property or by an option value.

For example let's say that I'm seeing the Taxon of an underwear collection. I'd like to filter the products shown, by providing a certain size (option_type). In this case I should list only products that have variants with the requested size.

I would like also to be able to filter the products by the "fit" property. Filtering by the slip fit, I should be able to list only products inside the current Taxon that have the required property.

This is the Taxon controller show action:

Spree::TaxonsController.class_eval do

    def show
      @taxon = Spree::Taxon.find_by_permalink!(params[:id])
      return unless @taxon

      @searcher = Spree::Config.searcher_class.new(params)
      @searcher.current_user = try_spree_current_user
      @searcher.current_currency = current_currency
      @products = @searcher.retrieve_products



How should I modify it to fit my needs?

Source: (StackOverflow)

What causes the "ArgumentError (dump format error)"?

While troubleshooting a misbehavior in Spree where the product list was not paginating and was only listing the first 10 products or so, I attempted to reproduce the error in my local development environment and on the first page load I received the error:

ArgumentError (dump format error)

As always, I checked my other brain first. The top search result was: https://github.com/rails/rails/issues/2509

Although the the user who started that thread and several of the other posters were attempting an upgrade from Rails 3.0.9 to Rails 3.1, I didn't think it would apply to my case. The Spree 0.60.2 app I'm running is at Rails 3.0.9.

However, as it turns out, simply clearing my localhost cookies solved the problem. Why?

Source: (StackOverflow)

Spree overriding helper method

I'm trying to overriding a helper method of base_helper.rb by using this:

module Spree
  module BaseHelper.class_eval do

    def taxons_tree(root_taxon, current_taxon, max_level = 1)


It's not working for me. Anyone know what I am missing here?

Thank you!


I should use:

Spree::BaseHelper.module_eval do

    def taxons_tree(root_taxon, current_taxon, max_level = 1)



Source: (StackOverflow)