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

前端 未结 20 878
别那么骄傲
别那么骄傲 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:32

    I got the same error. I had ruby 2.1.3 and rails 4.1.6 running on Mavericks and then I migrated to Yosemite and installed the 4.2.0 rails version an ruby 2.1.5 and my apps I made in the previous version didn't work with the new one, so I made some gem sets with RVM and installed the 2.1.3 version. Now when I wanted to run the server I got these error:

    bin/rails:6: warning: already initialized constant APP_PATH
    /Users/Lexynux/_WebProjects/RoR_Apps/SAIIP2/bin/rails:6: warning: previous definition of APP_PATH was here
    Usage: rails COMMAND [ARGS]
    

    And as tobu mentioned I ran:

    rake rails:update:bin
    

    I got this:

    LoadError: dlopen(/Users/Lexynux/.rvm/gems/ruby-2.1.3@SAIIP2/extensions/x86_64-darwin-14/2.1.0-static/mysql2-0.3.16/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
    

    Then I ran this:

    sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
    

    And finally I repeated the first command it the terminal asked me for this:

    Overwrite /Users/Lexynux/_WebProjects/RoR_Apps/SAIIP2/bin/rails? (enter "h" for help) [Ynaqdh]
    

    I just typed 'Y' and hit return.

    After all this I started working and going well.

    Thanks.

提交回复
热议问题