Getting syntax error when I start Rails command from terminal
Closed this issue · 2 comments
mhmdAljefri commented
I just added the request_migrations
gem without any extra config in Rails 7 project. but I got an issue when I try to start the server or run any other rails command. for eg:
when I try to run the command below on my terminal
rails start
I'm facing this Issue below ⬇️
/path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': /path/to/gems/ruby-3.0.1/gems/request_migrations-1.1.0/lib/request_migrations/migration.rb:82: syntax error, unexpected ',' (SyntaxError)
...ks << ConditionalBlock.new(if:, &block)
... ^
/path/to/gems/ruby-3.0.1/gems/request_migrations-1.1.0/lib/request_migrations/migration.rb:92: syntax error, unexpected ','
...ks << ConditionalBlock.new(if:, &block)
... ^
/path/to/gems/ruby-3.0.1/gems/request_migrations-1.1.0/lib/request_migrations/migration.rb:102: syntax error, unexpected ','
...ks << ConditionalBlock.new(if:, &block)
... ^
/path/to/gems/ruby-3.0.1/gems/request_migrations-1.1.0/lib/request_migrations/migration.rb:132: syntax error, unexpected end-of-input, expecting `end'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /path/to/gems/ruby-3.0.1/gems/request_migrations-1.1.0/lib/request_migrations.rb:9:in `<main>'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:61:in `each'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:50:in `each'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler/runtime.rb:50:in `require'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/bundler.rb:173:in `require'
from /path/to/Rails7/config/application.rb:7:in `<main>'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /path/to/gems/ruby-3.0.1/gems/railties-7.0.3.1/lib/rails/commands/server/server_command.rb:137:in `block in perform'
from <internal:kernel>:90:in `tap'
from /path/to/gems/ruby-3.0.1/gems/railties-7.0.3.1/lib/rails/commands/server/server_command.rb:134:in `perform'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/share/rvm/rubies/ruby-3.0.1/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /path/to/gems/ruby-3.0.1/gems/railties-7.0.3.1/lib/rails/command/base.rb:87:in `perform'
from /path/to/gems/ruby-3.0.1/gems/railties-7.0.3.1/lib/rails/command.rb:48:in `invoke'
from /path/to/gems/ruby-3.0.1/gems/railties-7.0.3.1/lib/rails/commands.rb:18:in `<main>'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /path/to/gems/ruby-3.0.1/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from bin/rails:4:in `<main>'
Any suggestion here please 🙏
ezekg commented
Ah, it looks like Ruby's new hash shorthand syntax is for Ruby 3.1, not Ruby 3.0 like I thought. I'm updating the docs and will be pushing out a new version, updating the minimum Ruby version. Try updating to Ruby 3.1. Sorry about that!
ezekg commented
Gem version 1.1.1 has been released.