Home > Blockchain >  Why is too hard to create a simple proyect with rails?
Why is too hard to create a simple proyect with rails?

Time:10-05

Only i want to create a simple proyect with ruby and rails, but i think its harder than it looked.

I have a version of ruby 2.6.8, i created a new project with this command rails new blog, after that cd to blog

i applied this command: bin/rails server

i am facing this error: bin/rails:4:in require_relative': cannot load such file -- .../rb/blog/config/boot (LoadError) from bin/rails:4:in '

CodePudding user response:

Did you already run bundle install? You need to do that before you can run the rails server.

CodePudding user response:

check with command:

ruby -v

that you ruby version same as in gemfile file, also as mention before don't forget run "bundle" after creating new project or add new gem to gemfile. If this didn't help and you rails version is 6 you can manually fix problem - create boilerplate config/boot.rb:

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

i am only start learning rails but i think if you only beginner then try fix problem in another way such reinstall rails, ruby etc. bc in future it can cause problem, its not normal when you just create new project and it already dont work, something wrong.

  • Related