Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5.2.1 seems to be breaking Solidus #2825

Closed
jacobherrington opened this issue Aug 8, 2018 · 17 comments
Closed

Rails 5.2.1 seems to be breaking Solidus #2825

jacobherrington opened this issue Aug 8, 2018 · 17 comments

Comments

@jacobherrington
Copy link
Contributor

jacobherrington commented Aug 8, 2018

Steps to reproduce

From Solidus bundle exec rake sandbox

Expected behavior

A new instance of Sandbox

Actual behavior

The remove_order_id_from_inventory_units migration fails.

screen shot 2018-08-08 at 11 22 30 am

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.

System configuration

Solidus Version: 2.7.0.alpha

Update -- Solutions:

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:

  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).

@jacobherrington
Copy link
Contributor Author

Related: rails/rails#33557

@vzqzac
Copy link
Contributor

vzqzac commented Aug 8, 2018

Issued on polyamorous/Related?: activerecord-hackery/polyamorous#45 and activerecord-hackery/polyamorous#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

@pedrofurtado
Copy link

@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.

@kennyadsl
Copy link
Member

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.

@kennyadsl kennyadsl changed the title Rails 5.2.1 seems to be breaking Sandbox migrations Rails 5.2.1 seems to be breaking Solidus Aug 9, 2018
@kennyadsl
Copy link
Member

kennyadsl commented Aug 9, 2018

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
Copy link
Member

Working on a PR (#2826).

@eduardopatrick
Copy link

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.

@docelic
Copy link
Contributor

docelic commented Aug 16, 2018

@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).

@fabioaraujo121
Copy link

Thanks, @docelic ! Saved a big time!

But, anyways, what is really happening with Solidus and Rails 5.2.1?

@docelic
Copy link
Contributor

docelic commented Aug 20, 2018

@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: activerecord-hackery/ransack#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.)

@louishugens
Copy link

man i can get rid of rails 5.2.1. help please :(

@docelic
Copy link
Contributor

docelic commented Aug 31, 2018

@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.

@louishugens
Copy link

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

@tvdeyen
Copy link
Member

tvdeyen commented Sep 2, 2018 via email

@louishugens
Copy link

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?

@docelic
Copy link
Contributor

docelic commented Sep 7, 2018

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'

@jacobherrington
Copy link
Contributor Author

Closing this issue after #2826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants