From Solidus bundle exec rake sandbox
A new instance of Sandbox
The remove_order_id_from_inventory_units migration fails.

Thanks to @VzqzAc for pointing out that the issue originates from https://github.com/activerecord-hackery
To be more clear, this is making impossible for us to support Rails 5.2.1 since ransack 1.8.8 is generating the error above and 1.8.9 does not support Rails 5.2 at all. - @kennyadsl
It seems we need to set Rails to 5.2.0 to get the migrations working.
Solidus Version: 2.7.0.alpha
Thanks @docelic for both of these solutions.
To use 5.2.1:
According to #2826 looks like it works with Rails 5.2.1 now.
Just the source needs to be taken from github and not the release (which isn't out yet), so the instruction from https://github.com/solidusio/solidus to install Solidus by adding the following to Gemfile:
gem 'solidus'
gem 'solidus_auth_devise'just needs to point solidus to GitHub, i.e. be:
gem 'solidus', github: 'solidusio/solidus'
gem 'solidus_auth_devise'
--
To use 5.2.0:
to just use Rails 5.2.0 and have it all working with Solidus (until the issue is resolved), there is just a small change you need to do:
- Create a new/test Rails project with option --skip-bundle or -B added at the end, e.g. "rails new myproject -B", so that it does not run bundler automatically. (Or if it does run it automatically, just press Ctrl+C to stop it). Just make sure you stop it before it installs Rails 5.2.1.
- Then edit the file "Gemfile", find line: "gem 'rails', '~> 5.2.0'" in it, and set version to just "5.2.0" so that the whole line becomes "gem 'rails', '5.2.0'
- Run "bundle" manually
- And from there you are good to go as you normally would
Also, if you already have Rails 5.2.1 because it got installed when bundler ran and you don't know how to remove it, then really the simplest way to start clean is to just create a new system user and install Ruby via a tool called RVM (https://rvm.io) in it. This will install Ruby locally under that account for maximum flexibility (e.g. you can just remove the whole ~/.rvm/ directory and try again if you don't get it right on the first try).
Issued on polyamorous/Related?: https://github.com/activerecord-hackery/polyamorous/issues/45 and https://github.com/activerecord-hackery/polyamorous/issues/46
Also seems like any migration with joins will fail, not only remove_order_id_from_inventory_units but looks like that's the first one using it in our queue
@VzqzAc @jacobherrington The ActiveRecord 5.2.1 changed the number of parameters used by some classes in Private API. Because of this, some gems from activerecord-hackery (ransack, polyamorous, etc.) is broken.
Ransack released a new gem version today (1.8.9). Unfortunately they decided (still not sure if that was intentional) to lock Rails compatibility up to 5.1.1. I opened a new issue on Ransack to understand better how to go head.
To be more clear, this is making impossible for us to support Rails 5.2.1 since ransack 1.8.8 is generating the error above and 1.8.9 does not support Rails 5.2 at all.
Working on a PR (#2826).
I'm testing by the first time and having the same problem, anyone could say how can I use thoose gems in a stable version. Sorry if I'm writting at the wrong place, but I really want to test solidus in my projects.
@eduardopatrick to just use Rails 5.2.0 and have it all working with Solidus (until the issue is resolved), there is just a small change you need to do:
1) Create a new/test Rails project with option --skip-bundle or -B added at the end, e.g. "rails new myproject -B", so that it does not run bundler automatically. (Or if it does run it automatically, just press Ctrl+C to stop it). Just make sure you stop it before it installs Rails 5.2.1.
2) Then edit the file "Gemfile", find line: "gem 'rails', '~> 5.2.0'" in it, and set version to just "5.2.0" so that the whole line becomes "gem 'rails', '5.2.0'
3) Run "bundle" manually
4) And from there you are good to go as you normally would
Also, if you already have Rails 5.2.1 because it got installed when bundler ran and you don't know how to remove it, then really the simplest way to start clean is to just create a new system user and install Ruby via a tool called RVM (https://rvm.io) in it. This will install Ruby locally under that account for maximum flexibility (e.g. you can just remove the whole ~/.rvm/ directory and try again if you don't get it right on the first try).
Thanks, @docelic ! Saved a big time!
But, anyways, what is really happening with Solidus and Rails 5.2.1?
@fabioaraujo121 thanks! The issue is not directly related to Solidus, and from what I see, the PR which we are waiting on which would fix the issue is here: https://github.com/activerecord-hackery/ransack/pull/951
(I believe after the above is merged, we're then waiting for a new/redone release of ransack 1.8.9 containing this fix.)
man i can get rid of rails 5.2.1. help please :(
@louishugens if you want to remove parts of rails 5.2.1, do as follows:
1) First run gem list to see all your installed gems. You might even run gem list | grep 5.2.1 to narrow the list to gems probably relating to rails 5.2.1
2) For each gem you want to remove, run gem uninstall GEM_NAME -v=5.2.1
If you have already ran 'bundle' with 5.2.1 left enabled, then these choices will remain remembered in file Gemfile.lock. So what you need to do (after changing version to 5.2.0 as advised above) is to run bundle update so that the versions get recalculated to 5.2.0.
Hope it helps.
Thanks @docelic ,the thing is even with "bundle update" and rails 5.2.0 specified in the gemfile, rails 5.2.1 is being installed. Maybe some other gem is requiring it? How to check that? Thanks
The Gemfile.lock is a dependency tree.
you are right @tvdeyen, it's rails 5.2.1 that i see in it. how can i get rid of it and replace with rails 5.2.0?
According to https://github.com/solidusio/solidus/pull/2826 looks like it works with Rails 5.2.1 now.
Just the source needs to be taken from github and not the release (which isn't out yet), so the instruction from https://github.com/solidusio/solidus to install Solidus by adding the following to Gemfile:
gem 'solidus'
gem 'solidus_auth_devise'
just needs to point solidus to GitHub, i.e. be:
gem 'solidus', github: 'solidusio/solidus'
gem 'solidus_auth_devise'
Closing this issue after #2826
Most helpful comment
@eduardopatrick to just use Rails 5.2.0 and have it all working with Solidus (until the issue is resolved), there is just a small change you need to do:
1) Create a new/test Rails project with option --skip-bundle or -B added at the end, e.g. "rails new myproject -B", so that it does not run bundler automatically. (Or if it does run it automatically, just press Ctrl+C to stop it). Just make sure you stop it before it installs Rails 5.2.1.
2) Then edit the file "Gemfile", find line: "gem 'rails', '~> 5.2.0'" in it, and set version to just "5.2.0" so that the whole line becomes "gem 'rails', '5.2.0'
3) Run "bundle" manually
4) And from there you are good to go as you normally would
Also, if you already have Rails 5.2.1 because it got installed when bundler ran and you don't know how to remove it, then really the simplest way to start clean is to just create a new system user and install Ruby via a tool called RVM (https://rvm.io) in it. This will install Ruby locally under that account for maximum flexibility (e.g. you can just remove the whole ~/.rvm/ directory and try again if you don't get it right on the first try).