Installed Ruby on Rails but when I try to run Rails Sever it doesn't load WEBrick?

后端 未结 5 1098
别跟我提以往
别跟我提以往 2021-01-15 09:24

I installed Ruby on Rails on my mac today along with Gems and MYsql. I\'m trying to follow the lynda.com tutorial and I\'ve run into a brick wall. When I try to run the rail

相关标签:
5条回答
  • 2021-01-15 09:38

    Forget the warning: Insecure world writable dir error, that's just a warning from Bundler and has nothing to do with the error that is keeping Rails from starting.

    That error is due to the Mysql2 gem not loading properly. I had the same problem. Basically you need the mysql source files for the gem to compile properly. I solved it by installing Homebrew, then installing mysql with Homebrew, then running Bundle install again.

    Try this:

    1. install Homebrew
    2. install mysql with hombrew: brew install mysql in a terminal
    3. delete the Gemfile.lock file inside your Rails app
    4. run 'bundle install` again
    5. try starting Rails with this command: bundle exec rails server

    I know I'm a little late to this party, but I'm hoping this might help someone else.

    0 讨论(0)
  • 2021-01-15 09:39

    You do seem to have permissions issues with your gems directory. Try resolving that with:

    sudo find /Library/Ruby/Gems/1.8/gems/ -type d -exec chmod 755 '{}' +
    
    0 讨论(0)
  • 2021-01-15 09:43

    This was answered here

    0 讨论(0)
  • 2021-01-15 09:51

    You have to set your Gemfile and run bundle install

    0 讨论(0)
  • 2021-01-15 09:54

    I strongly urge you to use rvm to install ruby and try again:

    • http://rvm.beginrescueend.com/

    There are a number of issues with the default ruby that ships with OS X. When you install RVM, you can easily get a clean installation of ruby.

    Make sure to read the install instructions carefully, especially the last bit about inserting a line into your .bashrc.

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