spree-contrib / spree_globalize Goto Github PK
View Code? Open in Web Editor NEWAdds support for model translations (multi-language stores) using Globalize gem
Home Page: https://spreecommerce.org
License: BSD 3-Clause "New" or "Revised" License
Adds support for model translations (multi-language stores) using Globalize gem
Home Page: https://spreecommerce.org
License: BSD 3-Clause "New" or "Revised" License
I was wondering if it is any useful to add templates originals SHA
s to spree_globalize's overrides file.
At least we won't get any WARNING during compilation.
If it's useful, I can do it
I want to add static page on spree. Since, I'm facing "undefined method `translates' for Store:Module (NoMethodError)" I'm not able to install 'spree_globalize',' spree_static_content' gem. Please help me to solve this issue.
ruby '2.5.0'
gem 'rails', '~> 5.2.0'
gem 'spree', '~> 3.6.3'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'
gem 'spree_cash_on_delivery', '1.0.0', path: 'vendor/gems/spree_cash_on_delivery-master'
gem 'vinsol_spree_themes', github: 'vinsol-spree-contrib/spree_themes', branch: 'master'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
gem 'globalize', git: 'https://github.com/globalize/globalize'
gem 'activemodel-serializers-xml'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content'
Bundler could not find compatible versions for gem "spree_core":
In snapshot (Gemfile.lock):
spree_core (= 4.0.3)
In Gemfile:
spree (~> 4.0) was resolved to 4.0.3, which depends on
spree_core (= 4.0.3)
spree_product_subscriptions was resolved to 3.2.0, which depends on
spree_core (>= 3.2.0, < 4.0)
Running bundle update
will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict
What is the safest way to uninstall this gem?
During tests we realised that translations are not available for some Tabs in Admin Panel, as an effect the user can see names in English only when it comes to Tax Rates.
##Steps to reproduce:
1.Switch language to German (DE)
2. Go to PDP & purchase the product
3. Observe Order Summary (Bestelubersicht) field on Shipment (Versand) Step
4.Observe that in German you do not use word "TAX" but “Steuer” for Tax
5.Login to AP
6. go to /admin/tax_rates
7.AAA I cannot set a translation for this tax, I cannot also assign Tax Rate to a store where using a different name could be a solution
What is currently possible:
There is a workaround - creating dedicated Zones considering language differences for EU Countries, but this could be solved on translation level.
can someone please set the master
branch as main one and enable the project to travis?
thanks
/cc @JDutil
We already discussed this.. but i still think we should change Spree::Globalize
to SpreeGlobalize
.
I like the first but that's inconsistent with every other spree extension, i18n included.
From the readme:
SpreeI18n::Config.available_locales = [:en, :es, :'pt-BR']
Spree::Globalize::Config.supported_locales = [:en, :'pt-BR']
/cc @tvdeyen
After upgrading from spree 4.3.1 to 4.4.0, the following no longer works:
It will just append a # to the end of the URL and not switch the field. Looks like a critical bug, since this gem is kinda useless now, unless we're expected to set translations through the rails console.
We use images from https://www.localeapp.com/assets/flags/languages/<%= locale %>.png
and similar.
This works well but will break al the apps of the world when localeapp will decide to change something.
We don't even use localeapp :)
Here is the error:
Bundler could not find compatible versions for gem "spree":
In snapshot (Gemfile.lock):
spree (= 3.4.1)
In Gemfile:
spree (~> 3.4.0)
spree_globalize was resolved to 3.3.0, which depends on
spree_i18n was resolved to 1.0.0, which depends on
spree (~> 1.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
The output is
ActiveModel::UnknownAttributeError in Spree::Admin::PagesController#create
unknown attribute 'page_id' for Spree::Page::Translation.
Sorry but I have
ruby 2.7.1
rails 6.0.3.2
and I have
gem 'spree', '~> 4.1'
gem 'spree_auth_devise', '~> 4.1'
gem 'spree_gateway', '~> 3.7'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize'
and I have problem with spree_page_translatiosn
Trying to solve it, firstly I had to execute
ALTER TABLE spree_page_translations RENAME spree_page_id TO page_id;
because didn't recognize spree_page_id
and then, when I tried to translate a page I can't
and It returned me
Spree::Page::Translation Exists? (0.2ms) SELECT 1 AS one FROM "spree_page_translations" WHERE "spree_page_translations"."slug" = $1 AND "spree_page_translations"."locale" = $2 LIMIT $3 [["slug", "prueba buena"], ["locale", "en"], ["LIMIT", 1]]
(0.2ms) ROLLBACK
00:29
Can anyone help me? Thank you very much. Do I have to download versions of rails? Someone has worked out spree_static_content and spree_globalize? thanks for all
If is set a custom admin_path admin_translations routes are still with /admin and not with the overwrite.
Spree.config do |config|
config.admin_path = 'backend'
end
Routes for Spree::Core::Engine:
admin_translations GET /admin/:resource/:resource_id/translations(.:format) spree/admin/translations#index
admin_option_type_option_value PATCH /admin/option_values/:id(.:format) spree/admin/option_values#update
admin_translate_product_property PATCH /admin/product/:id/product_properties/:id(.:format) spree/admin/product_properties#translate
admin_unauthorized GET /backend/authorization_failure(.:format) spree/admin/user_sessions#authorization_failure
admin_login GET /backend/login(.:format) spree/admin/user_sessions#new
I am getting the "wrong number of arguments (given 3, expected 1..2)" error when trying to run the install command (rails g spree_globalize:install)
Rails version: 6.1.4
Spree version: 4.4.0
Steps to recreate:
Here is a part of the stack trace:
**home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/associations.rb:1457:in has_many': wrong number of arguments (given 3, expected 1..2) (ArgumentError)** from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:73:in
block in included'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in class_eval' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in
included'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in include' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in
block in use'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in map' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in
use'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/friendly_id-5.4.2/lib/friendly_id/base.rb:210:in friendly_id' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:33:in
class:Product'
from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:22:in <module:Spree>' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/spree/product.rb:21:in
require' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'require' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/zeitwerk-2.5.3/lib/zeitwerk/kernel.rb:27:in
require'activate' from /home/vladan/.rvm/gems/ruby-3.0.3/gems/activesupport-6.1.4.4/lib/active_support/callbacks.rb:427:in
instance_exec'We are unable to translate Payment Methods for Spree
According to Spree Guides there are some model translations which are still missing - with internationalization we would like to be able to add those translations in translations fields
https://guides.spreecommerce.org/developer/customization/i18n.html#model-translations
Error with label for adjustment line item when using spree globalize. The database value of label is Promotion Label
I am trying to install with spree 3.3 but getting below errors
Bundler could not find compatible versions for gem "activerecord":
In snapshot (Gemfile.lock):
activerecord (= 5.1.3)
In Gemfile:
spree_globalize was resolved to 3.2.0.alpha, which depends on
globalize was resolved to 3.0.0, which depends on
paper_trail (> 2) was resolved to 2.6.3, which depends on> 3.0)
activerecord (
rails (~> 5.1.3) was resolved to 5.1.3, which depends on
activerecord (= 5.1.3)
Running bundle update
will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "rails":
In snapshot (Gemfile.lock):
rails (= 5.1.3)
In Gemfile:
spree_globalize was resolved to 3.2.0.alpha, which depends on
globalize was resolved to 3.0.0, which depends on
paper_trail (> 2) was resolved to 2.0.0, which depends on> 3)
rails (
spree (~> 3.3.0) was resolved to 3.3.0, which depends on
spree_core (= 3.3.0) was resolved to 3.3.0, which depends on
rails (~> 5.1.1)
Running bundle update
will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Previously posted on spree/spree#6837:
I'm using Spree and Spree_i18n on edge master branch.
I'm not able to use product filters with translated properties, this is my current working progress to fix the issue :
The filter always returns 0 products
module Spree
module Core
Spree::Product.add_search_scope :age_category_any do |*opts|
byebug
conds = opts.map {|o| ProductFilters.age_category_filter[:conds][o]}.reject { |c| c.nil? }
scope = conds.shift
conds.each do |new_scope|
scope = scope.or(new_scope)
end
Spree::Product.with_translations.with_property(144).where(scope)
end
def ProductFilters.age_category_filter
age_category_property = Spree::Property.with_translations(I18n.locale).find_by(name: 'age_category')
# age_category_property.id = 144
age_categories = age_category_property ? Spree::ProductProperty.with_translations(I18n.locale).where(property_id: age_category_property.id).map(&:value).uniq.map(&:to_s) : []
pp = Spree::ProductProperty.arel_table
conds = Hash[*age_categories.map { |b| [b, pp[:value].eq(b)] }.flatten]
{
name: age_category_property.presentation,
scope: :age_category_any,
conds: conds,
labels: (age_categories.sort).map { |k| [k, k] }
}
end
end
end
(byebug) Spree::Product.with_translations.with_property(144).count
CACHE (0.0ms) SELECT DISTINCT locale FROM "spree_product_translations" ORDER BY "spree_product_translations"."locale" ASC
(9.0ms) SELECT COUNT(DISTINCT "spree_products"."id") FROM "spree_products" INNER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants"."is_master" = $1 AND "spree_variants"."deleted_at" IS NULL INNER JOIN "spree_prices" ON "spree_prices"."variant_id" = "spree_variants"."id" AND "spree_prices"."deleted_at" IS NULL INNER JOIN "spree_product_translations" ON "spree_product_translations"."spree_product_id" = "spree_products"."id" INNER JOIN "spree_product_properties" ON "spree_product_properties"."product_id" = "spree_products"."id" INNER JOIN "spree_properties" ON "spree_properties"."id" = "spree_product_properties"."property_id" LEFT OUTER JOIN "spree_products_taxons" ON "spree_products_taxons"."product_id" = "spree_products"."id" WHERE "spree_products"."deleted_at" IS NULL AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2015-10-16 17:40:14.577192') AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2015-10-16 17:40:14.577582') AND ("spree_products".available_on <= '2015-10-16 17:40:14.577806') AND "spree_products_taxons"."taxon_id" = 28 AND "spree_product_translations"."locale" IN ('en', 'fr') AND "spree_properties"."id" = 144 [["is_master", "t"]]
81
(byebug) Spree::Product.with_translations.with_property(144).where(scope).count
CACHE (0.0ms) SELECT DISTINCT locale FROM "spree_product_translations" ORDER BY "spree_product_translations"."locale" ASC
CACHE (0.0ms) SELECT COUNT(DISTINCT "spree_products"."id") FROM "spree_products" INNER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants"."is_master" = $1 AND "spree_variants"."deleted_at" IS NULL INNER JOIN "spree_prices" ON "spree_prices"."variant_id" = "spree_variants"."id" AND "spree_prices"."deleted_at" IS NULL INNER JOIN "spree_product_translations" ON "spree_product_translations"."spree_product_id" = "spree_products"."id" INNER JOIN "spree_product_properties" ON "spree_product_properties"."product_id" = "spree_products"."id" INNER JOIN "spree_properties" ON "spree_properties"."id" = "spree_product_properties"."property_id" LEFT OUTER JOIN "spree_products_taxons" ON "spree_products_taxons"."product_id" = "spree_products"."id" WHERE "spree_products"."deleted_at" IS NULL AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2015-10-16 17:40:14.577192') AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2015-10-16 17:40:14.577582') AND ("spree_products".available_on <= '2015-10-16 17:40:14.577806') AND "spree_products_taxons"."taxon_id" = 28 AND "spree_product_translations"."locale" IN ('en', 'fr') AND "spree_properties"."id" = 144 AND "spree_product_properties"."value" = '18 mois à 12 ans' [["is_master", true]]
0
I think my arel_table
method doesn't support translated product_properties.
Is someone could help me ?
BTW, thanks for your awesome job on Spree :)
Moved from spree-contrib/spree_i18n#530
I can't destroy my spree product because of it translation. From rails console:
shipping_category = Spree::ShippingCategory.create! name: 'Test shipping category'
# OK
product = Spree::Product.create! name: 'Product 1', price: 1.0, shipping_category: shipping_category
# OK
product.really_destroy!
# RuntimeError: Can't modify frozen hash
I beleave this is because of punch_slug
method of the translation_class. This method calls on after_destroy
, and when we really destroing object, we can't call update
, because the object is frozen.
I have a brand new install of Spree, and am attempting to add spree_i18n and spree_globalize. Here is my Gemfile setup:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'spree', '~> 3.1.0.rc1'
gem 'spree_auth_devise', '~> 3.1.0.rc1'
gem 'spree_gateway', '~> 3.1.0.rc1'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
This results in a dependency error:
Bundler could not find compatible versions for gem "spree_i18n":
In Gemfile:
spree_i18n
spree_globalize was resolved to 3.1.0.beta, which depends on
spree_i18n (~> 3.1.0.beta)
If you open the administration, Products, the list is not sortable according to name. This is because the spree_products.name column is empty when using spree_globalize. Any ideas how to fix it? I've spent way too much hours trying to figure out and I'm desperate.
I have spree_globalize installed and I translate everything perfectly in the backend.
But how do I change the language in the front end?
I can't find a way to show the typical language selector on the front. Is it activated in any way?
Hello,
after trying to post new shipping method in admin I got server stacked.
Started POST "/admin/shipping_methods" for 127.0.0.1 at 2016-08-31 14:06:15 +0200
ActiveRecord::SchemaMigration Load (2.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Spree::Admin::ShippingMethodsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"wfaKkyjn0PqhRejMp8l9UiBdd+OiHe4Fev7RibbWc0R+AYlM7XsHQhmnhJzooDM8Z0fNnXbByno4WuefaPv9ZA==", "shipping_method"=>{"name"=>"GLS", "display_on"=>"", "admin_name"=>"gls", "code"=>"12", "tracking_url"=>"", "shipping_categories"=>["1"], "zones"=>["1"], "calculator_type"=>"Spree::Calculator::Shipping::FlexiRate", "tax_category_id"=>""}, "button"=>""}
Spree::Preference Load (0.6ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = ? LIMIT 1 [["key", "spree/backend_configuration/locale"]]
Spree::User Load (2.7ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = ? ORDER BY "spree_users"."id" ASC LIMIT 1 [["id", 1]]
Spree::Role Load (0.8ms) SELECT "spree_roles".* FROM "spree_roles" INNER JOIN "spree_role_users" ON "spree_roles"."id" = "spree_role_users"."role_id" WHERE "spree_role_users"."user_id" = ? [["user_id", 1]]
Completed 500 Internal Server Error in 738ms (ActiveRecord: 12.6ms)
SystemStackError (stack level too deep):
app/controllers/spree/admin/shipping_methods_controller_decorator.rb:10:in `set_shipping_category'
I tried to use:
alias_method_chain :old_set_shipping_category, :set_shipping_category
alias_method_chain :old_set_zones, :set_zones
but no luck...
Spree v3.1.0
Rails v4.2.6
Hello, is there a way to localize prices ?! for example i'm using EGP as default currency i want prices to appear as '100 EGP' is locale is en and as '١٠٠ ج.م' if locale is ar
When you are on a product page and change the language, it will produce a 404 because the slug is different for the other language.
Not sure if this is caused by this gem or spree_legacy_frontend. Seems like a basic and essential feature that is missing though. I found github issues pointing this out 8 years ago and surprised it's still the case. Is there a workaround?
If I run the migrations from zero, the CreateStoreFromPreferences migration fails because the decorator makes the Store attributes translatable but the migration for the Store-translations table comes at the end of all migrations. Do I have to reorder my migrations?
Readme says installer will modify frontend/all.* files, but it actually only modifies backend/all.*, not sure which is correct.
Spree::Property.where(name: "alcohol")
works
Spree::Property.find_by(name: "alcohol")
doesnt work.
if i have time, i will add some tests
On a fresh Spree installation I get the following error
/usr/local/rvm/gems/ruby-3.2.0/bundler/gems/spree_globalize-1c6eb9e15daa/lib/spree_globalize/engine.rb:11:in `block in <class:Engine>': uninitialized constant SpreeGlobalize::Configuration (NameError)
SpreeGlobalize::Config = SpreeGlobalize::Configuration.new
^^^^^^^^^^^^^^^
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:32:in `instance_exec'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:32:in `run'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:61:in `block in run_initializers'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:50:in `each'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:50:in `tsort_each_child'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:415:in `call'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `each'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `call'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
from /usr/local/rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/initializable.rb:60:in `run_initializers'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/application.rb:372:in `initialize!'
from /app/app/src/config/environment.rb:5:in `<main>'
from /usr/local/rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /usr/local/rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /usr/local/rvm/gems/ruby-3.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /usr/local/rvm/gems/ruby-3.2.0/gems/zeitwerk-2.6.10/lib/zeitwerk/kernel.rb:38:in `require'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/application.rb:348:in `require_environment!'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/command/actions.rb:28:in `require_environment!'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/commands/generate/generate_command.rb:21:in `perform'
from /usr/local/rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
from /usr/local/rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/command/base.rb:87:in `perform'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/command.rb:48:in `invoke'
from /usr/local/rvm/gems/ruby-3.2.0/gems/railties-7.0.6/lib/rails/commands.rb:18:in `<main>'
from /usr/local/rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /usr/local/rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from bin/rails:4:in `<main>'
Gemfile
gem 'spree', '~> 4.6'
gem 'spree_sample', '~> 4.6'
gem 'spree_emails', '~> 4.6'
gem 'spree_backend', '~> 4.6'
gem 'spree_gateway', '~> 3.10'
gem 'spree_auth_devise', '~> 4.5'
gem 'spree_i18n', '~> 5.1'
gem 'spree_dev_tools', require: false, group: %w[test development]
gem 'spree_globalize', github: 'spree-contrib/spree_globalize'
I was missing some translations I had to add by hand. They don't belong to i18n, maybe they should be in the repo?
de:
spree:
i18n:
translations: Übersetzungen
store_translations: Store Übersetzungen
Hi there, I try to get an fresh installed Spree Shop running with "spree_globalize".
• When I am logged in as admin
• and I click on products
• Then I see this error:
ActiveRecord::StatementInvalid in Spree::Admin::Products#index
Showing /Users/janjezek/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spree_backend-3.6.4/app/views/spree/admin/products/index.html.erb where line #68 raised:
Mysql2::Error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'demo520-spree_development.spree_products.name' which is not in SELECT list; this is incompatible with DISTINCT: SELECT DISTINCT `spree_products`.`id`, `spree_products`.`available_on`, `spree_products`.`discontinue_on`, `spree_products`.`deleted_at`, `spree_products`.`tax_category_id`, `spree_products`.`shipping_category_id`, `spree_products`.`created_at`, `spree_products`.`updated_at`, `spree_products`.`promotionable` FROM `spree_products` WHERE `spree_products`.`deleted_at` IS NULL AND (`spree_products`.discontinue_on IS NULL or `spree_products`.discontinue_on >= '2018-10-14 19:08:22.259918') ORDER BY `spree_products`.`name` ASC LIMIT 25 OFFSET 0
129 | def query(sql, options = {})
130 Thread.handle_interrupt(::Mysql2::Util::TIMEOUT_ERROR_CLASS => :never) do
131 _query(sql, @query_options.merge(options))
132 end
133 end
Full Stacktrace here: http://pasted.co/2c4be2fa
activemodel-serializers-xml
and globalize
to resolve the dependenies)ruby '2.5.1'
gem 'rails', '~> 5.2.0'
gem 'spree', '~> 3.6.4'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
gem 'globalize', git: 'https://github.com/globalize/globalize'
gem 'activemodel-serializers-xml'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize'
I uploaded a git Repo to jumpstart:
https://github.com/exocode/demo520-spree364
• git clone [email protected]:exocode/demo520-spree364.git
• cd demo520-spree364
• bundle install
• nano database.yml
to your needs
• rake db:snapshot:restore
to restore same state where it fails
I hope someone can help me.
Hey, this is not really an "issue" but I wanted to let you know that I forked this project and switched to the mobility gem, which is recommended by globalize authors as the successor to globalize (not actively developed anymore).
Mobility works very, very similarly to globalize, but there are a few subtleties that had to be updated. All the database stuff remains the same so it's a drop-in replacement.
I also fixed some bugs and I plan to update the admin views a bit because it bothers me that product description has no WYSIWYG editor, for example.
I will switch to it in production next week.
If you want you could add a note about this gem in the readme, spree guides or elsewhere, as an alternative to spree_globalize.
https://github.com/mrbrdo/spree_mobility
Also just want to point out that spree itself still includes a few lines of code pertaining to SpreeGlobalize, which should really be extracted into spree_globalize
, for example like I've done for SpreeMobility: mrbrdo/spree_mobility@7d81cb2
Regards, Jan
It seams frontend js is removed but in readme it steal exists and it causes to exception
The page will load with a list of products that belong to that taxon
PG::GroupingError
PG::GroupingError: ERROR: column "spree_product_translations.id" must appear in the GROUP BY clause or be used in an aggregate function
The Spree_Globalize gem preloads translations by adding to the spree_base_scope
method.
#preload translations
def spree_base_scopes
super.includes(:translations).references(:translations)
end
The addition of this preloaded scope causes the generated SQL query to be invalid. The SQL query that is failing is listed below.
By removing the .includes(:translations).references(:translations)
from the spree_base_scopes
method in SpreeGlobalize::Translatable
the query succeeds. You can see this in action on our fork. https://github.com/ECHOInternational/spree_globalize
The generated SQL becomes much simpler and works properly:
SELECT DISTINCT spree_products.*, MIN(spree_products_taxons.position) AS min_position
FROM "spree_products"
INNER JOIN "spree_products_stores" ON "spree_products"."id" = "spree_products_stores"."product_id"
INNER JOIN "spree_variants" ON "spree_variants"."deleted_at" IS NULL AND "spree_variants"."product_id" = "spree_products"."id"
INNER JOIN "spree_prices" ON "spree_prices"."deleted_at" IS NULL AND "spree_prices"."variant_id" = "spree_variants"."id"
INNER JOIN "spree_products_taxons" ON "spree_products_taxons"."product_id" = "spree_products"."id" WHERE "spree_products"."deleted_at" IS NULL AND "spree_products_stores"."store_id" = 4 AND "spree_prices"."currency" = 'USD' AND "spree_prices"."amount" IS NOT NULL AND "spree_products_taxons"."taxon_id" = 55 AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2021-08-25 19:02:05.891093') AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2021-08-25 19:02:05.891439') AND ("spree_products".available_on <= '2021-08-25 19:02:05.891420') AND "spree_prices"."currency" = 'USD' AND "spree_prices"."amount" IS NOT NULL AND "spree_products_taxons"."taxon_id" = 55
GROUP BY "spree_products"."id"
ORDER BY "min_position" ASC
LIMIT 12
OFFSET 0
Compare this to the generated query below that is currently created and fails:
SELECT DISTINCT spree_products.*, MIN(spree_products_taxons.position) AS min_position,
"spree_products"."id" AS t0_r0,
"spree_product_translations"."id" AS t1_r0,
"spree_product_translations"."spree_product_id" AS t1_r1,
"spree_product_translations"."locale" AS t1_r2,
"spree_product_translations"."created_at" AS t1_r3,
"spree_product_translations"."updated_at" AS t1_r4,
"spree_product_translations"."name" AS t1_r5,
"spree_product_translations"."description" AS t1_r6,
"spree_product_translations"."meta_description" AS t1_r7,
"spree_product_translations"."meta_keywords" AS t1_r8,
"spree_product_translations"."slug" AS t1_r9,
"spree_product_translations"."deleted_at" AS t1_r10,
"spree_product_translations"."meta_title" AS t1_r11,
"spree_tax_categories"."id" AS t2_r0,
"spree_tax_categories"."name" AS t2_r1,
"spree_tax_categories"."description" AS t2_r2,
"spree_tax_categories"."is_default" AS t2_r3,
"spree_tax_categories"."deleted_at" AS t2_r4,
"spree_tax_categories"."created_at" AS t2_r5,
"spree_tax_categories"."updated_at" AS t2_r6,
"spree_tax_categories"."tax_code" AS t2_r7,
"spree_variants"."id" AS t3_r0,
"spree_variants"."sku" AS t3_r1,
"spree_variants"."weight" AS t3_r2,
"spree_variants"."height" AS t3_r3,
"spree_variants"."width" AS t3_r4,
"spree_variants"."depth" AS t3_r5,
"spree_variants"."deleted_at" AS t3_r6,
"spree_variants"."is_master" AS t3_r7,
"spree_variants"."product_id" AS t3_r8,
"spree_variants"."cost_price" AS t3_r9,
"spree_variants"."position" AS t3_r10,
"spree_variants"."cost_currency" AS t3_r11,
"spree_variants"."track_inventory" AS t3_r12,
"spree_variants"."tax_category_id" AS t3_r13,
"spree_variants"."updated_at" AS t3_r14,
"spree_variants"."discontinue_on" AS t3_r15,
"spree_variants"."created_at" AS t3_r16,
"spree_assets"."id" AS t4_r0,
"spree_assets"."viewable_type" AS t4_r1,
"spree_assets"."viewable_id" AS t4_r2,
"spree_assets"."attachment_width" AS t4_r3,
"spree_assets"."attachment_height" AS t4_r4,
"spree_assets"."attachment_file_size" AS t4_r5,
"spree_assets"."position" AS t4_r6,
"spree_assets"."attachment_content_type" AS t4_r7,
"spree_assets"."attachment_file_name" AS t4_r8,
"spree_assets"."type" AS t4_r9,
"spree_assets"."attachment_updated_at" AS t4_r10,
"spree_assets"."alt" AS t4_r11,
"spree_assets"."created_at" AS t4_r12,
"spree_assets"."updated_at" AS t4_r13,
"active_storage_attachments"."id" AS t5_r0,
"active_storage_attachments"."name" AS t5_r1,
"active_storage_attachments"."record_type" AS t5_r2,
"active_storage_attachments"."record_id" AS t5_r3,
"active_storage_attachments"."blob_id" AS t5_r4,
"active_storage_attachments"."created_at" AS t5_r5,
"active_storage_blobs"."id" AS t6_r0,
"active_storage_blobs"."key" AS t6_r1,
"active_storage_blobs"."filename" AS t6_r2,
"active_storage_blobs"."content_type" AS t6_r3,
"active_storage_blobs"."metadata" AS t6_r4,
"active_storage_blobs"."byte_size" AS t6_r5,
"active_storage_blobs"."checksum" AS t6_r6,
"active_storage_blobs"."created_at" AS t6_r7,
"active_storage_blobs"."service_name" AS t6_r8,
"spree_variants"."id" AS t7_r0,
"spree_variants"."sku" AS t7_r1,
"spree_variants"."weight" AS t7_r2,
"spree_variants"."height" AS t7_r3,
"spree_variants"."width" AS t7_r4,
"spree_variants"."depth" AS t7_r5,
"spree_variants"."deleted_at" AS t7_r6,
"spree_variants"."is_master" AS t7_r7,
"spree_variants"."product_id" AS t7_r8,
"spree_variants"."cost_price" AS t7_r9,
"spree_variants"."position" AS t7_r10,
"spree_variants"."cost_currency" AS t7_r11,
"spree_variants"."track_inventory" AS t7_r12,
"spree_variants"."tax_category_id" AS t7_r13,
"spree_variants"."updated_at" AS t7_r14,
"spree_variants"."discontinue_on" AS t7_r15,
"spree_variants"."created_at" AS t7_r16,
"spree_prices"."id" AS t8_r0,
"spree_prices"."variant_id" AS t8_r1,
"spree_prices"."amount" AS t8_r2,
"spree_prices"."currency" AS t8_r3,
"spree_prices"."deleted_at" AS t8_r4,
"spree_prices"."created_at" AS t8_r5,
"spree_prices"."updated_at" AS t8_r6,
"spree_prices"."compare_at_amount" AS t8_r7,
"images_spree_variants"."id" AS t9_r0,
"images_spree_variants"."viewable_type" AS t9_r1,
"images_spree_variants"."viewable_id" AS t9_r2,
"images_spree_variants"."attachment_width" AS t9_r3,
"images_spree_variants"."attachment_height" AS t9_r4,
"images_spree_variants"."attachment_file_size" AS t9_r5,
"images_spree_variants"."position" AS t9_r6,
"images_spree_variants"."attachment_content_type" AS t9_r7,
"images_spree_variants"."attachment_file_name" AS t9_r8,
"images_spree_variants"."type" AS t9_r9,
"images_spree_variants"."attachment_updated_at" AS t9_r10,
"images_spree_variants"."alt" AS t9_r11,
"images_spree_variants"."created_at" AS t9_r12,
"images_spree_variants"."updated_at" AS t9_r13,
"attachment_attachments_spree_assets"."id" AS t10_r0,
"attachment_attachments_spree_assets"."name" AS t10_r1,
"attachment_attachments_spree_assets"."record_type" AS t10_r2,
"attachment_attachments_spree_assets"."record_id" AS t10_r3,
"attachment_attachments_spree_assets"."blob_id" AS t10_r4,
"attachment_attachments_spree_assets"."created_at" AS t10_r5,
"blobs_active_storage_attachments"."id" AS t11_r0,
"blobs_active_storage_attachments"."key" AS t11_r1,
"blobs_active_storage_attachments"."filename" AS t11_r2,
"blobs_active_storage_attachments"."content_type" AS t11_r3,
"blobs_active_storage_attachments"."metadata" AS t11_r4,
"blobs_active_storage_attachments"."byte_size" AS t11_r5,
"blobs_active_storage_attachments"."checksum" AS t11_r6,
"blobs_active_storage_attachments"."created_at" AS t11_r7,
"blobs_active_storage_attachments"."service_name" AS t11_r8
FROM "spree_products"
INNER JOIN "spree_products_stores" ON "spree_products"."id" = "spree_products_stores"."product_id"
INNER JOIN "spree_variants" ON "spree_variants"."deleted_at" IS NULL AND "spree_variants"."product_id" = "spree_products"."id"
INNER JOIN "spree_prices" ON "spree_prices"."deleted_at" IS NULL AND "spree_prices"."variant_id" = "spree_variants"."id"
INNER JOIN "spree_products_taxons" ON "spree_products_taxons"."product_id" = "spree_products"."id"
LEFT OUTER JOIN "spree_assets" ON "spree_assets"."viewable_type" = 'Spree::Variant' AND "spree_assets"."viewable_id" = "spree_variants"."id"
LEFT OUTER JOIN "active_storage_attachments" ON "active_storage_attachments"."record_type" = 'Spree::Asset' AND "active_storage_attachments"."name" = 'attachment' AND "active_storage_attachments"."record_id" = "spree_assets"."id"
LEFT OUTER JOIN "active_storage_blobs" ON "active_storage_blobs"."id" = "active_storage_attachments"."blob_id"
LEFT OUTER JOIN "spree_assets" "images_spree_variants" ON "images_spree_variants"."viewable_type" = 'Spree::Variant' AND "images_spree_variants"."viewable_id" = "spree_variants"."id"
LEFT OUTER JOIN "active_storage_attachments" "attachment_attachments_spree_assets" ON "attachment_attachments_spree_assets"."record_type" = 'Spree::Asset' AND "attachment_attachments_spree_assets"."name" = 'attachment' AND "attachment_attachments_spree_assets"."record_id" = "images_spree_variants"."id"
LEFT OUTER JOIN "active_storage_blobs" "blobs_active_storage_attachments" ON "blobs_active_storage_attachments"."id" = "attachment_attachments_spree_assets"."blob_id"
LEFT OUTER JOIN "spree_product_translations" ON "spree_product_translations"."spree_product_id" = "spree_products"."id"
LEFT OUTER JOIN "spree_tax_categories" ON "spree_tax_categories"."deleted_at" IS NULL AND "spree_tax_categories"."id" = "spree_products"."tax_category_id"
WHERE "spree_products"."deleted_at" IS NULL
AND "spree_products_stores"."store_id" = 4
AND "spree_prices"."currency" = 'USD'
AND "spree_prices"."amount" IS NOT NULL
AND "spree_products_taxons"."taxon_id" = 37
AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2021-08-24 22:55:19.312492')
AND ("spree_products".discontinue_on IS NULL or "spree_products".discontinue_on >= '2021-08-24 22:55:19.312792')
AND ("spree_products".available_on <= '2021-08-24 22:55:19.312777')
AND "spree_prices"."currency" = 'USD'
AND "spree_prices"."amount" IS NOT NULL
AND "spree_products_taxons"."taxon_id" = 37
GROUP BY "spree_products"."id"
ORDER BY "min_position"
ASC
LIMIT 12
OFFSET 0
rack-mini-profiler (2.3.2) lib/patches/db/pg.rb:72:in `exec_params'
rack-mini-profiler (2.3.2) lib/patches/db/pg.rb:72:in `exec_params'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
activesupport (6.1.4.1) lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
activesupport (6.1.4.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
activesupport (6.1.4.1) lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
activerecord (6.1.4.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:53:in `exec_query'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
activerecord (6.1.4.1) lib/active_record/relation.rb:838:in `block (2 levels) in exec_queries'
activerecord (6.1.4.1) lib/active_record/relation/finder_methods.rb:421:in `apply_join_dependency'
activerecord (6.1.4.1) lib/active_record/relation.rb:833:in `block in exec_queries'
activerecord (6.1.4.1) lib/active_record/relation.rb:861:in `skip_query_cache_if_necessary'
activerecord (6.1.4.1) lib/active_record/relation.rb:828:in `exec_queries'
activerecord (6.1.4.1) lib/active_record/association_relation.rb:54:in `exec_queries'
activerecord (6.1.4.1) lib/active_record/relation.rb:631:in `load'
activerecord (6.1.4.1) lib/active_record/relation.rb:249:in `records'
bullet (6.1.5) lib/bullet/active_record61.rb:46:in `records'
activerecord (6.1.4.1) lib/active_record/relation/delegation.rb:88:in `each'
spree_core (4.3.0.rc2) app/helpers/spree/products_helper.rb:71:in `map'
spree_core (4.3.0.rc2) app/helpers/spree/products_helper.rb:71:in `cache_key_for_products'
app/views/spree/shared/_products.html.erb:9
actionview (6.1.4.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.4.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.4.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.4.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.4.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.4.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.4.1) lib/action_view/renderer/partial_renderer.rb:285:in `block in render_partial_template'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/partial_renderer.rb:280:in `render_partial_template'
actionview (6.1.4.1) lib/action_view/renderer/partial_renderer.rb:271:in `render'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:53:in `render_partial'
actionview (6.1.4.1) lib/action_view/helpers/rendering_helper.rb:45:in `render'
app/views/spree/products/index.html.erb:36
actionview (6.1.4.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.4.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.4.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.4.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.4.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.4.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:61:in `block (2 levels) in render_template'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:56:in `block in render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:22:in `render'
actionview (6.1.4.1) lib/action_view/helpers/rendering_helper.rb:38:in `block in render'
actionview (6.1.4.1) lib/action_view/base.rb:273:in `in_rendering_context'
actionview (6.1.4.1) lib/action_view/helpers/rendering_helper.rb:34:in `render'
app/views/spree/taxons/show.html.erb:8
actionview (6.1.4.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.4.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.4.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.4.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.4.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.4.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:61:in `block (2 levels) in render_template'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:56:in `block in render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:71:in `block in render_with_layout'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:70:in `render_with_layout'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.1.4.1) lib/action_view/rendering.rb:117:in `block in _render_template'
actionview (6.1.4.1) lib/action_view/base.rb:273:in `in_rendering_context'
actionview (6.1.4.1) lib/action_view/rendering.rb:116:in `_render_template'
actionpack (6.1.4.1) lib/action_controller/metal/streaming.rb:218:in `_render_template'
actionview (6.1.4.1) lib/action_view/rendering.rb:103:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (6.1.4.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
/usr/local/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
activesupport (6.1.4.1) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:86:in `cleanup_view_runtime'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:45:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/implicit_render.rb:35:in `default_render'
actionpack (6.1.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
actionpack (6.1.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
actionpack (6.1.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:228:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:117:in `block in run_callbacks'
actiontext (6.1.4.1) lib/action_text/rendering.rb:20:in `with_renderer'
actiontext (6.1.4.1) lib/action_text/engine.rb:59:in `block (4 levels) in <class:Engine>'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `instance_exec'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sentry-raven (3.1.2) lib/raven/integrations/rails/controller_transaction.rb:7:in `block in included'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `instance_exec'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:165:in `process'
actionview (6.1.4.1) lib/action_view/rendering.rb:39:in `process'
actionpack (6.1.4.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.1.4.1) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `public_send'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `method_missing'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:420:in `call_app!'
omniauth_openid_connect (0.3.5) lib/omniauth/strategies/openid_connect.rb:143:in `other_phase'
omniauth (1.9.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:192:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:192:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:192:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:192:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
omniauth (1.9.1) lib/omniauth/strategy.rb:192:in `call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in `call'
flipper (0.22.1) lib/flipper/middleware/memoizer.rb:67:in `memoized_call'
flipper (0.22.1) lib/flipper/middleware/memoizer.rb:42:in `call'
scout_apm (4.1.2) lib/scout_apm/instant/middleware.rb:53:in `call'
scout_apm (4.1.2) lib/scout_apm/middleware.rb:20:in `call'
bullet (6.1.5) lib/bullet/rack.rb:15:in `call'
flipper (0.22.1) lib/flipper/middleware/memoizer.rb:77:in `memoized_call'
flipper (0.22.1) lib/flipper/middleware/memoizer.rb:42:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.1.4.1) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
actionpack (6.1.4.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (6.1.4.1) lib/active_record/migration.rb:601:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.1.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.1.4.1) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:37:in `tagged'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `tagged'
railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack-cache (1.12.1) lib/rack/cache/context.rb:141:in `forward'
rack-cache (1.12.1) lib/rack/cache/context.rb:267:in `fetch'
rack-cache (1.12.1) lib/rack/cache/context.rb:196:in `lookup'
rack-cache (1.12.1) lib/rack/cache/context.rb:67:in `call!'
rack-cache (1.12.1) lib/rack/cache/context.rb:52:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/static.rb:24:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/host_authorization.rb:98:in `call'
sentry-raven (3.1.2) lib/raven/integrations/rack.rb:51:in `call'
rack-mini-profiler (2.3.2) lib/mini_profiler/profiler.rb:384:in `call'
webpacker (5.4.2) lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
rack-proxy (0.7.0) lib/rack/proxy.rb:63:in `call'
railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
puma (5.4.0) lib/puma/configuration.rb:249:in `call'
puma (5.4.0) lib/puma/request.rb:77:in `block in handle_request'
puma (5.4.0) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
puma (5.4.0) lib/puma/request.rb:76:in `handle_request'
puma (5.4.0) lib/puma/server.rb:440:in `process_client'
puma (5.4.0) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
in the spree admin when find variants by product name using this url
/api/v1/variants?q%5Bproduct_name_or_sku_cont%5D=jar&token=xxx&_=yyyyy
the api response a empty result because don't use product translations table, in 3-0-stable spree_i18n had a variant decorator that solve this but it was removed.
Spree 3.4.3
spree_i18n - master
spree_globalize - master
Hi!
When i add the gem to my gemfile and run bundle install
i get this error:
Bundler could not find compatible versions for gem "spree_i18n":
In snapshot (Gemfile.lock):
spree_i18n (= 3.0.0)
In Gemfile:
spree_globalize (>= 0) ruby depends on
spree_i18n (~> 3.1.0.beta) ruby
spree_i18n (>= 0) ruby
rails new mystore2
cd mystore2
spree install --auto-accept
"Spree has been installed successfully. You're all ready to go!"
Good, lets check that.
rails s
yep, everything works.
good, now i want to add i18n, so i put
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'master'
in my gemfile like
https://github.com/spree-contrib/spree_i18n says.
So my total gemfile looks like this:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'spree', '3.0.1'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'master'
-->when running bundle install
it gives me this:
Updating git://github.com/spree-contrib/spree_i18n.git
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Bundler could not find compatible versions for gem "spree_core":
In snapshot (Gemfile.lock):
spree_core (= 3.0.1)
In Gemfile:
spree (= 3.0.1) ruby depends on
spree_sample (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree_gateway (>= 0) ruby depends on
spree_core (~> 3.0.0) ruby
spree_gateway (>= 0) ruby depends on
spree_core (~> 3.0.0) ruby
spree (= 3.0.1) ruby depends on
spree_sample (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_sample (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_sample (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_sample (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree_i18n (>= 0) ruby depends on
spree_core (~> 3.1.0.beta) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
so i gave it a go: --> bundle update
:
Updating git://github.com/spree/spree_gateway.git
Updating git://github.com/spree/spree_auth_devise.git
Updating git://github.com/spree-contrib/spree_i18n.git
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...............
Bundler could not find compatible versions for gem "spree_core":
In Gemfile:
spree (= 3.0.1) ruby depends on
spree_frontend (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_frontend (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_frontend (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_frontend (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree (= 3.0.1) ruby depends on
spree_frontend (= 3.0.1) ruby depends on
spree_core (= 3.0.1) ruby
spree_auth_devise (>= 0) ruby depends on
spree_core (~> 3.0.0) ruby
spree_auth_devise (>= 0) ruby depends on
spree_core (~> 3.0.0) ruby
spree_i18n (>= 0) ruby depends on
spree_core (~> 3.1.0.beta) ruby
after googling around for I while i tried setting
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'master'
to
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: '3-0-stable'
--> bundle install
--> yay, no errors. "Bundle complete! . . . ."
--> rails g spree_i18n:install
--> worked.
And when i restart the server I can choose the available and supported locales from the admin. Perfect!
Now i want to translate the models as well.
so i add
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
to the gemfile which looks like this right now:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'spree', '3.0.1'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: '3-0-stable'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
but when I run bundle install
i get this error:
Updating git://github.com/spree-contrib/spree_globalize.git
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Bundler could not find compatible versions for gem "spree_i18n":
In snapshot (Gemfile.lock):
spree_i18n (= 3.0.0)
In Gemfile:
spree_globalize (>= 0) ruby depends on
spree_i18n (~> 3.1.0.beta) ruby
spree_i18n (>= 0) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
and I dont get it to work. I'm new to spree, so I think I'm missing something simple. But I rebuilt the project several times step by step from the docs & I get the same error everytime. I'm thankful for every help.
Are there plans to support Postgres? At the moment it does not work due to invalid SQL being generated in regards to DISTINCT/ORDER and GROUP BY.
The app works fine until one adds spree_globalize, then it starts failing at multiple points.
It seems this was already fixed by #92 more than 6 months ago, but it still wasn't merged yet. Can you please check the PR and merge it? You are breaking support for one of the more popular DBs.
This gem is extracted from spree_i18n but now it is not compatible with spree 3. In worth case, we can't find any branch for spree 3.0.
Getting folllowing error with latest version of thsis library,
Url:http://localhost:3000/admin/stores/1/translations
Showing /Users/prakash/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/spree_globalize-5e2e8134c9f5/app/views/spree/admin/translations/_fields.html.erb where line #6 raised:
undefined method `translated_attribute_names' for
Spree 4.3 (and probably higher)
"Link settings" in Navigation and "Link to" in CMS Page Sections does not work properly:
Autocomplete select of Taxons/Products is not responding correctly.
The problem is probably the empty "attributes" attribute in JSON response (no titles of objects there). Unfortunately, I didn't succeed yet with any patch solution.
I have managed to install spree globalize on Spree v.4.4.0.
In the backend everything seems to be in order. I can insert translations for taxons, products stores etc.
However, when I try ro make API calls from the next.js storefront i get a bunch of errors in spree
a lot of "unpermitted parameter" erors such as:
Unpermitted parameter: :taxon
Unpermitted parameters: :image_transformation, :product
Relation passed to #or must be structurally compatible. Incompatible values: [:readonly, :distinct]
Here is a part of the stack trace before and after the erorr:
Unpermitted parameter: :cms_page
Unpermitted parameter: :taxon
Unpermitted parameter: :cms_page
Unpermitted parameter: :taxon
Unpermitted parameter: :taxon
`Relation passed to #or must be structurally compatible. Incompatible values: [:readonly, :distinct]
(1.8ms) SELECT COUNT(*) FROM (SELECT 1 AS one FROM "spree_cms_pages" WHERE "spree_cms_pages"."deleted_at" IS NULL AND "spree_cms_pages"."store_id" = $1 AND "spree_cms_pages"."locale" = $2 LIMIT $3 OFFSET $4) subquery_for_count [["store_id", 1], ["locale", "sr"], ["LIMIT", 500], ["OFFSET", 0]]
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation/query_methods.rb:725:in `or!'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation/query_methods.rb:715:in `or'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/concerns/spree/product_scopes.rb:340:in `block in get_taxons'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/concerns/spree/product_scopes.rb:336:in `map'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/concerns/spree/product_scopes.rb:336:in `get_taxons'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/spree_core-4.4.0/app/models/concerns/spree/product_scopes.rb:110:in `block (2 levels) in <module:ProductScopes>'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation/delegation.rb:108:in `public_send'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation/delegation.rb:108:in `block in method_missing'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation.rb:406:in `block in scoping'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation.rb:804:in `_scoping'
/home/vladan/.rvm/gems/ruby-3.0.3/gems/activerecord-6.1.4.4/lib/active_record/relation.rb:406:in `scoping'`
GET /api/v2/storefront/taxons?filter%5Bparent_permalink%5D=meni
USE eager loading detected
Spree::Taxon => [:translations]
Add to your query: .includes([:translations])
Call stack
GET /api/v2/storefront/taxons?filter%5Bparent_permalink%5D=meni
AVOID eager loading detected
Spree::Taxon => [:parent, :children, :taxonomy]
Remove from your query: .includes([:parent, :children, :taxonomy])
Call stack
GET /api/v2/storefront/taxons?filter%5Bparent_permalink%5D=meni
AVOID eager loading detected
Spree::Taxon => [:icon, :parent, :taxonomy]
Remove from your query: .includes([:icon, :parent, :taxonomy])
Call stack
GET /api/v2/storefront/taxons?filter%5Bparent_permalink%5D=meni
AVOID eager loading detected
Spree::Taxonomy => [:root]
Remove from your query: .includes([:root])
Call stack
So it seams that spree_globalize is not compatible with version 4.4.0 and the storefrint API.
Is there a fix for this ?
Can't add localization settings in admin General settings.
Working only with initializer:
SpreeI18n::Config.available_locales = [:en, :es, :'pt-BR'] # displayed on frontend select box
SpreeGlobalize::Config.supported_locales = [:en, :'pt-BR'] # displayed on translation forms
Spree v3.1.0
Rails v4.2.6
This was discussed and fixed here spree-contrib/spree_i18n#418, than reverted here spree-contrib/spree_i18n#478 .
Still a big performance problem, we should find a way to use with_translation
, includes(:translations)
or whatever
/cc @hnatt @BlackPrincess
Upgrading to Ruby 3.0 and Spree 4.2.0.rc5 and getting this:
/Users/vasco/.rvm/gems/ruby-3.0.0/gems/activerecord-6.1.2.1/lib/active_record/associations.rb:1457:in `has_many': wrong number of arguments (given 3, expected 1..2) (ArgumentError)
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:73:in `block in included'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in `class_eval'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in `included'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in `include'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:57:in `block in use'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in `map'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-5.4.2/lib/friendly_id/configuration.rb:54:in `use'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/friendly_id-5.4.2/lib/friendly_id/base.rb:210:in `friendly_id'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_core-4.2.0.rc5/app/models/spree/product.rb:26:in `<class:Product>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_core-4.2.0.rc5/app/models/spree/product.rb:22:in `<module:Spree>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_core-4.2.0.rc5/app/models/spree/product.rb:21:in `<main>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/inflector/methods.rb:288:in `const_get'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/inflector/methods.rb:288:in `block in constantize'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/inflector/methods.rb:284:in `each'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/inflector/methods.rb:284:in `inject'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/inflector/methods.rb:284:in `constantize'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_backend-4.2.0.rc5/app/controllers/spree/admin/resource_controller.rb:100:in `belongs_to'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_backend-4.2.0.rc5/app/controllers/spree/admin/product_properties_controller.rb:4:in `<class:ProductPropertiesController>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_backend-4.2.0.rc5/app/controllers/spree/admin/product_properties_controller.rb:3:in `<module:Admin>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_backend-4.2.0.rc5/app/controllers/spree/admin/product_properties_controller.rb:2:in `<module:Spree>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spree_backend-4.2.0.rc5/app/controllers/spree/admin/product_properties_controller.rb:1:in `<main>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/app/controllers/spree/admin/product_properties_controller_decorator.rb:22:in `<main>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/app/controllers/spree/admin/product_properties_controller_decorator.rb:3:in `<module:Admin>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/app/controllers/spree/admin/product_properties_controller_decorator.rb:2:in `<module:Spree>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/app/controllers/spree/admin/product_properties_controller_decorator.rb:1:in `<main>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/lib/spree_globalize/engine.rb:27:in `block in activate'
from <internal:dir>:134:in `glob'
from /Users/vasco/.rvm/gems/ruby-3.0.0/bundler/gems/spree_globalize-aa011eaaff7d/lib/spree_globalize/engine.rb:26:in `activate'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:427:in `instance_exec'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:427:in `block in make_lambda'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:603:in `catch'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:603:in `block in default_terminator'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:199:in `block in halting'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:512:in `block in invoke_before'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:512:in `each'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:512:in `invoke_before'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/callbacks.rb:105:in `run_callbacks'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/reloader.rb:88:in `prepare!'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/initializable.rb:32:in `run'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `each'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `call'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
from /Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/railties-6.1.2.1/lib/rails/application.rb:384:in `initialize!'
from /Users/vasco/Documents/rails/hello-coffee/config/environment.rb:5:in `<main>'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/dependencies.rb:332:in `block in require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.2.1/lib/active_support/dependencies.rb:332:in `require'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
from /Users/vasco/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from <internal:/Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/vasco/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
Looks like friendly_id-globalize
is not compatible with Ruby 3.0?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.