Problems with WEBrick crashing
Sorry, I don't know the answer to your question but I can offer a potential workaround you might be happy with: use Mongrel instead of WEBrick. Mongrel runs faster and is completely compatible. And maybe it won't crash when a route isn't found. Most Rails developers haven't used WEBrick in a few years.
To use Mongrel:
gem install mongrel
If Rails finds Mongrel it will use it automatically.
Hope that fixes it!
Start webrick in port 80 (mysql2 gem issue)
It seems that the mysql2 gem is not installed in the ruby run time that is used. however as this works for you without sudo, i suspect that you have rvm installed and you are using the rvm ruby (which has mysql installed) by default when lunching rails without sudo. but when you do sudo you are most probably using the system ruby which doesn't have mysql2 installed.
so in short if you have rvm installed and is using that. just use:
rvmsudo rails server -p 80
cannot load such file -- webrick/httputils
You have spring
in your gemfile, usually hanging consoles and servers are related to that. The webrick
gem was removed from the standard library in Ruby 3, so that's why it needs to be included in your Gemfile.
Add webrick
to your Gemfile, do a bundle install, and then stop the background spring server with bin/spring stop
. Then re-run the server.
Your best bet on solving issues with spring would be to head over and read about the gem on the GitHub project page, or opening a new question here on SO.
Issue when trying to run WEBrick and Rails
Okay so after further research I found my own answer
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib
This did it for me. Just incase anyone else can't move past this problem with the original solutions.
Source: http://samuel.kadolph.com/2011/04/mysql2-gem-and-mac-os-x-image-not-found/
Unable to start the Webrick server with Ruby on Rails
Seems to be similar to this question
cannot load such file -- sqlite3/sqlite3_native (LoadError) on ruby on rails
Perhaps try the suggestions there and see if that helps?
Problem launching WEBrick in Rails
Install MySQL on your machine. You can get it here.
After that, you need to have:
gem 'mysql'
In your Gemfile.
Related Topics
Capistrano 3 Change Ssh_Options Inside Task
Symbol#To_Proc with Custom Methods
How to Decode Q-Encoded Strings in Ruby
Can't Run Bundle Update on Windows
How to More Elegantly Remove Duplicate Items Across All Elements of a Ruby Array
Eliminate Consecutive Duplicates of List Elements
How to Decode a Cookie from the Header of a Websocket Connection Handshake? (Ruby)
How to Use Same Browser Window for Automated Test Using Selenium-Webdriver (Ruby)
Install Cocoapods Failed on MAC
Session Not Destroyed When Closing Browser - Railstutorial.Org
How to Do Ruby Object Serialization Using JSON
Modifying the Default Hash Value
What Does the Term "Vendoring" or "To Vendor" Mean for Ruby on Rails
Failure: Expected 0 to Be >= 1 on Ruby on Rails
Method Invocation in Class Definition
Issues Installing Ruby and Rails and Devkit on Windows 7 X64 - Fix Needed