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

Bug: Error running rails db:setup on a fresh install #370

Open
joelbrewer opened this issue Oct 15, 2019 · 8 comments
Open

Bug: Error running rails db:setup on a fresh install #370

joelbrewer opened this issue Oct 15, 2019 · 8 comments

Comments

@joelbrewer
Copy link

Running rails db:setup returns an error.

🐞 Problem

I performed a fresh clone, bundle install, and subsequent rails db:setup and received the following error:

rails aborted!
FrozenError: can't modify frozen String: "railties_load_path="
/Users/joelbrewer/Repos/railsgoat/config/application.rb:4:in require' /Users/joelbrewer/Repos/railsgoat/config/application.rb:4:in <top (required)>'
/Users/joelbrewer/Repos/railsgoat/Rakefile:5:in require_relative' /Users/joelbrewer/Repos/railsgoat/Rakefile:5:in <top (required)>'
script/rails:7:in require' script/rails:7:in

'

Steps to reproduce:

  • git clone
  • bundle install
  • rails db:setup

💡 Possible solutions

I have a feeling this could be a ruby/rails version issue (I noticed the Ruby version was recently upgraded).

@jasnow
Copy link
Contributor

jasnow commented Oct 15, 2019

What version of ruby are you using?

@joelbrewer
Copy link
Author

image

Using rbenv -- this was the only 2.7.0 version available.

@jasnow
Copy link
Contributor

jasnow commented Oct 15, 2019

I use rvm with .rvmrc: rvm use [email protected] --create

@joelbrewer
Copy link
Author

Got it - I'll try using rvm 👍

@treisland
Copy link

treisland commented Oct 19, 2019

Any update on. This has been a nightmare to install on a fresh ubuntu instance as well as a docker container.

@cktricky
Copy link
Contributor

@treprime are you using RVM as noted above?

@treisland
Copy link

treisland commented Oct 20, 2019

@cktricky I managed to get it working on my instance of Ubuntu. Steps below

  • Install ruby and ruby-build

     sudo apt-get install ruby \
     ruby-build -y
    
  • Install mysql

      sudo apt-get install mysql-server \
      mysql-client \
      libmysqlclient-dev
    
  • Install rvm (ruby version manager)

      curl -sSL https://get.rvm.io | bash
    
  • source the directory

      source ~/.rvm/scripts/rvm
    
  • Install the bundler

      gem install bundler
    
  • Clone railsgoat

      git clone https://github.com/OWASP/railsgoat.git
      cd railsgoat
    
  • Install ruby 2.7 preview

      rvm install "ruby-2.7.0-preview1"
    
  • Install the bundles

      bundle install
    
  • Setup the database

      bundle exec rake db:setup
    
  • Start the server

      bundle exec rails server
    
  • Open a browser and navigate to http://localhost:3000

@cktricky
Copy link
Contributor

Thank you @tre-island. I think I need to try and build this on a fresh ubuntu install to see what we could improve on our end.

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