rails server bin/rails:6: warning: already initialized constant APP_PATH error

前端 未结 20 742
别那么骄傲
别那么骄傲 2020-11-30 22:42

I\'ve tried a number of things like uninstalling/reinstalling rails and gems but to no avail.

When I go into my new project and run rails s or bundle exec rails serv

相关标签:
20条回答
  • 2020-11-30 23:13

    My problem was I was using an outdated version of ruby 1.9.3 with rails 4.2. I upgraded to 2.1.2 , removed the broken project, ran rails new blog to recreate my project, navigated into my newly created app and ran rails server and it worked.

    0 讨论(0)
  • 2020-11-30 23:13

    I just had this problem and found that it was being caused by the fact that I had removed a gem from the gemfile without deleting the other require references. In my case, I just had to remove it from config/application.rb.

    0 讨论(0)
  • 2020-11-30 23:16

    This is work for me.

    gem uninstall mysql2

    bundle install or gem install mysql2

    0 讨论(0)
  • 2020-11-30 23:17

    IF rake rails:update:bin gives additional errors:

    I had recently been doing some server maintenance and had subsequently updated OpenSSL.

    When I tried running the rake rails:update:bin command, I was presented with an error relating to openSSL.

    Having rebuilt my version of Ruby (`rvm reinstall ruby-x.x.x' with RVM), both errors went away.

    This is always worth a try I guess.

    0 讨论(0)
  • 2020-11-30 23:20

    I was getting the same error. Removed spring from Gemfile and re-bundled. Not really a solution though.

    I found the code that created this error in config/initializers/an_initializer.rb

    require "lib/a_file_i_need"
    

    I changed it for

    require "#{ Rails.root }/lib/a_file_i_need"
    
    0 讨论(0)
  • 2020-11-30 23:21

    rake rails:update:bin to the rescue.

    0 讨论(0)
提交回复
热议问题