0

I am new to ruby on rails hence when i am trying to create new project by following command: rails new abc I am getting following error

rails aborted! Psych::BadAlias: Unknown alias: default /home/iftikhar/Desktop/abc/bin/rails:9:in <top (required)>' /home/iftikhar/Desktop/abc/bin/spring:15:in require' /home/iftikhar/Desktop/abc/bin/spring:15:in <top (required)>' ./bin/rails:3:in load' ./bin/rails:3:in `' Tasks: TOP => app:template (See full trace by running task with --trace)

3
  • What version of Ruby (ruby -v) and Rails (rails -v) do you use? Commented Jan 24, 2022 at 18:28
  • ruby 3.1.0 rails 6.0.4.4 Commented Jan 24, 2022 at 18:29
  • You should edit the question properly! If it's code, for example, you can select once you have pasted it, and press 'ctrl+k'. Commented Feb 4, 2022 at 9:50

2 Answers 2

1

According to this page Rails 6.0 is not compatible with Ruby 3.1. This makes sense because Ruby 3.1 was released just a couple of days ago but Rails 6.0.4.4 was released more than a year ago and was the last release of Rails 6.0 since then. Furthermore, it is worth noting that Rails 6.0 is not actively maintained anymore.

I suggest using the latest Ruby on Rails (7.0.1) version when you want to start a new project. Or if you really need to work with Rails 6.0 (what I would not recommend) then you will need to downgrade Ruby to 2.7.5

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks alot, by upgrading to rails latest version my problem has been solved for now
0

Within config/database.yml rename default: to x-default:.

https://stackoverflow.com/a/71944400/2675670

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.