You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
I tried creating a new Rails app and ran into a few issues. Turns out I had Rails 7 installed, thus
The app was created in a --skip-spring, instead of using the name provided. Based on my quick experimentation, this behaviour changed in Rails 7 Fix: Fix rails new command for Rails 7 #1812
bundle install failed because rails new picked up Rails 7 alpha, and the shopify_app gem does not support Rails 7. Not sure what the best fix would be here, either make shopify_app Rails 7 ready, or hardcode a Rails version in the CLI that we know works.
Expected behavior
The Rails app is created and it all just works.
Actual behavior
Bundle install fails:
✓ Adding shopify_app gem…
┏━━ Running bundle install… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ Fetching gem metadata from https://rubygems.org/............
┃ Resolving dependencies...
┃ Bundler could not find compatible versions for gem "rails":
┃ In snapshot (Gemfile.lock):
┃ rails (= 7.0.0.alpha2)
┃
┃ In Gemfile:
┃ rails (~> 7.0.0.alpha2)
┃
┃ shopify_app (>= 17.0.3) was resolved to 17.1.1, which depends on
┃ rails (< 6.1, > 5.2.1)
┃
┃ Running `bundle update` will rebuild your snapshot from scratch, using only
┃ the gems in your Gemfile, which may resolve the conflict.
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (2.26s)
✗ System call failed: ~/.gem/ruby/3.0.2/bin/bundle install
I'm running into the same problem. Is there a workaround?
You might be able to edit Shopify CLI's code to specify Rails version, e.g. Rails 6.1.
1. `gem install rails -v '6.1.4.4'`
2. Edit either [`lib/shopify_cli/services/app/create/rails_service.rb`](https://github.com/Shopify/shopify-cli/blob/8a280492c44d458c44fde3883f16ecfd494afdc4/lib/shopify_cli/services/app/create/rails_service.rb#L161) or [`lib/project_types/rails/commands/create.rb`](https://github.com/Shopify/shopify-cli/blob/8a280492c44d458c44fde3883f16ecfd494afdc4/lib/project_types/rails/commands/create.rb#L158) (not sure which file is actually used). Instead of having it run `rails new`, force a specific rails version: `rails _6.1.4.4_ new`. Note that the underscores are required.
Thanks for the help! This resolved the initial issue but I ran into this later on in the install.
┏━━ Running webpacker:install…
┃ rails aborted!
┃ Don't know how to build task 'webpacker:install' (See the list of available tasks with rails --tasks)
┃
┃ (See full trace by running task with --trace)
┏━━ Error
┃ ✗ System call failed: rails webpacker:install
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
I think it has to do with ruby 3.0.3. After switching to ruby 2.7.5 the command shopify app create rails worked without issue.
Issue summary
I tried creating a new Rails app and ran into a few issues. Turns out I had Rails 7 installed, thus
--skip-spring
, instead of using the name provided. Based on my quick experimentation, this behaviour changed in Rails 7 Fix: Fixrails new
command for Rails 7 #1812bundle install
failed becauserails new
picked up Rails 7 alpha, and theshopify_app
gem does not support Rails 7. Not sure what the best fix would be here, either makeshopify_app
Rails 7 ready, or hardcode a Rails version in the CLI that we know works.Expected behavior
The Rails app is created and it all just works.
Actual behavior
Bundle install fails:
Steps to reproduce the problem
gem install rails --alpha
)shopify app create rails
The text was updated successfully, but these errors were encountered: