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

Nokogiri Error on fresh install #1041

Open
gekkota opened this issue Jan 3, 2023 · 8 comments
Open

Nokogiri Error on fresh install #1041

gekkota opened this issue Jan 3, 2023 · 8 comments

Comments

@gekkota
Copy link

gekkota commented Jan 3, 2023

I get an error about nokogiri on a brand new install...

Connection to postgres (172.19.0.3) 5432 port [tcp/postgresql] succeeded! PostgreSQL is up and running! Resolving dependencies.... The Gemfile's dependencies are satisfied rails aborted! LoadError: cannot load such file -- nokogiri /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in require' /bundle/ruby/3.0.0/gems/loofah-2.19.0/lib/loofah.rb:4:in

'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/rails-html-sanitizer-1.4.3/lib/rails-html-sanitizer.rb:2:in <main>' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/actionview-7.0.4/lib/action_view/helpers/sanitize_helper.rb:3:in '
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/actionview-7.0.4/lib/action_view/helpers.rb:8:in <main>' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/context.rb:1:in '
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/railtie.rb:10:in <main>' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/railtie.rb:4:in '
/bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails.rb:10:in require_relative' /bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails.rb:10:in '
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/sass-rails-6.0.0/lib/sass-rails.rb:1:in <main>' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /app/config/application.rb:7:in '
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/app/rakefile:4:in <main>' /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:20:in block in perform'
/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in perform' /bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command.rb:51:in invoke'
/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in <main>' /bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require'
/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' bin/rails:4:in '
(See full trace by running task with --trace)`

@muhwyndhamhp
Copy link

Up on this issue. I have the same problem.

@Deekor
Copy link

Deekor commented Jan 14, 2023

Yep, getting this when using the CLI to install the dockerized version

@rafalcymerys
Copy link
Member

Hi @gekkota @muhwyndhamhp @Deekor could you provide some steps to reproduce this issue? I tried doing a clean setup via CLI, but it doesn't happen for me.

Also, it would be helpful if you could share some more details (OS, CPU architecture etc.)

@muhwyndhamhp
Copy link

muhwyndhamhp commented Jan 17, 2023

Hi @rafalcymerys thanks for the response. The step I took to reproduce this issue is exactly the same as the getting started step in spree docs during CLI install:

npx @spree/cli new app

The problem occurs after the docker image for the web and backend was created. I was finally able to fix the issue by downloading the starter project (not via npx cli) and manually modifying Dockerfile.development to not copy the Gemfile.lock (Just the Gemfile) and delete the Gemfile.lock file from repo.

Seems like a version of nokogiri which doesn't compatible with the docker image were included in the Gemfile.lock file, where I saw these versions of nokogiri included:

nokogiri (1.13.9-arm64-darwin)
      racc (~> 1.4)
    nokogiri (1.13.9-x86_64-darwin)
      racc (~> 1.4)
    nokogiri (1.13.9-x86_64-linux)

After I ran bundle install via docker image shipped with the starter, it changes into followings:

nokogiri (1.14.0-aarch64-linux)

And then it ran normally.

Edit: forgot to mention the system I'm in:

  • macOS Ventura 13.1
  • Macbook Pro M2
  • 8GB of RAM
  • Ruby 3.2.0 installed via homebrew

@rafalcymerys
Copy link
Member

rafalcymerys commented Jan 17, 2023

Hi @gekkota @muhwyndhamhp - are you using the Spree 4.5 (dockerized) or Spree 4.5 (hybrid) mode in the CLI?

@muhwyndhamhp
Copy link

I'm using 4.5 dockerized version @rafalcymerys

@rafalcymerys
Copy link
Member

Oh, I just see your comment regarding architecture @muhwyndhamhp - my main dev machine is x86 and that's why I wasn't able to reproduce the issue. Let me think about the best possible solution. I'm wondering whether we need Gemfile.lock in this repo at all - this could probably be generated the moment someone downloads a clean spree_starter and runs bundle install for the first time.

@muhwyndhamhp
Copy link

I have tried modify the Dockerfile and it appears that Gemfile.lock file is not necessary @rafalcymerys. It can ran properly and regenerate the proper Gemfile.lock file anyway whenever bundle install ran.

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

4 participants