So I've been running this rails server for about a month now and after rebooting the computer (I was trying to add global environment variables on my mac) the server now kicks out this error when I run "rails s". I've made sure that both localhost and the virtual domain are pointing to 127.0.0.1 as well. As I said, before rebooting, this was working fine, but afterwards is when the error popped up.
=> Booting Unicorn
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn- 4.8.3/lib/unicorn/configurator.rb:604:in `pack_sockaddr_in': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:604:in `canonicalize_tcp'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:590:in `expand_addr'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:236:in `listen'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `block in bind_new_listeners!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `each'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `bind_new_listeners!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:138:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-rails-2.2.0/lib/unicorn_rails.rb:33:in `run'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:286:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/chris/bbplm/bin/rails:8:in `require'
from /Users/chris/bbplm/bin/rails:8:in `<top (required)>'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `load'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `call'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/command.rb:7:in `call'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/chris/bbplm/bin/spring:16:in `require'
from /Users/chris/bbplm/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
After removing spring from the gemfile, I bundle installed and tried re-running the server. This is the error I received.
=> Booting Unicorn
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:604:in `pack_sockaddr_in': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:604:in `canonicalize_tcp'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/configurator.rb:590:in `expand_addr'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:236:in `listen'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `block in bind_new_listeners!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `each'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:809:in `bind_new_listeners!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:138:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/unicorn-rails-2.2.0/lib/unicorn_rails.rb:33:in `run'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:286:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/chris/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
check etc/hostshas 127.0.0.1 localhost
This was my issue, although where and how it went i have no idea!
Related
I am attempting to set up a new Rails app and keep getting the following stack trace:
=> Booting Puma
=> Rails 5.1.0.rc1 application starting in development on http://linux-my4o:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.2 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://linux-my4o:9292
Exiting
/home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': getaddrinfo: Name or service not known (SocketError)
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `new'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `add_tcp_listener'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:44:in `start'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:130:in `block in perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125:in `tap'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125:in `perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/command/base.rb:63:in `perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/command.rb:44:in `invoke'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands.rb:16:in `<top (required)>'
from /home/chris/Projects/cwatsondev-api/bin/rails:9:in `require'
from /home/chris/Projects/cwatsondev-api/bin/rails:9:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/chris/Projects/cwatsondev-api/bin/spring:15:in `require'
from /home/chris/Projects/cwatsondev-api/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I've never seen an error like this when running a rails server before. I'm using Rails 5.1.0.rc1 on OpenSuse Tumbleweed. It looks to me like it's having an issue with the hostname linux-my4o.
I figured it out. Just had to add a new line to my etc/hosts file.
127.0.0.1 linux-my4o
I fixed mine by adding the following lines to my environment variables. For linux i added the following line
export HOST="localhost"
if this does not work especially because rails is complaining that the HOST envvar will be depreciated, use this instead
export BINDING="localhost"
I'm really new to ruby and rails and I was trying to follow the odin project's installfest but couldn't seem to get past thru the install phase. I tried running rails server but it keeps exiting and giving me this error. Can anyone help? Thank you very much.
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.2 (ruby 2.3.3-p222), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Exiting
/Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:249:in `gethostbyname': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:249:in `localhost_addresses'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:262:in `add_tcp_listener'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/macbookpro/railsbridge/test_app/bin/rails:9:in `require'
from /Users/macbookpro/railsbridge/test_app/bin/rails:9:in `<top (required)>'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /Users/macbookpro/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /Users/macbookpro/railsbridge/test_app/bin/spring:15:in `require'
from /Users/macbookpro/railsbridge/test_app/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
you can try to delete server.pid that is in tmp/pids path. it is probably you have already started the server in another terminal tab or window.
I recently had to uninstall rvm and then reinstall rvm and reinstall rails --
It appears that rails didn't install correctly because I can't launch rails s. I'm working with ruby 2.3.0, and ran sudo gem install rails to get the latest version of rails.
After installing and running bundle install and bundle update, I got this error
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mkdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
Permission denied - ./.gem.20160330-64997-1erpjjg
Gem files will remain installed in /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /Users/chloe/.rvm/gems/ruby-2.3.0#global/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.7.2/gem_make.out
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `block in mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:142:in `create'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mktmpdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/ext_conf_builder.rb:14:in `build'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `chdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `synchronize'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in `use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.6/bin/rails:9:in `<top (required)>'
from /usr/bin/rails:22:in `load'
from /usr/bin/rails:22:in `<main>'
I tried using the solution from this question, but got 'apt-get command not found' --- but I apologize if this requires a similar solution!
I'm using Mac OSX
EDIT ****
after updating gems with gem update ---system, I have a new error message:
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/chloe/sites/bookshelf/config/environment.rb:7:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /Users/chloe/sites/bookshelf/config.ru:3:in `require'
from /Users/chloe/sites/bookshelf/config.ru:3:in `block in <main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from /Users/chloe/sites/bookshelf/config.ru:in `new'
from /Users/chloe/sites/bookshelf/config.ru:in `<main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `require'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `require'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
[1]: https://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror
****SOLUTION****
the solution from this question appeared to fix it:
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
This appeared to solve the problem:
For the first issue--
run
gem update --system
For second issue --
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
here's the error I get:
iMac:raddit Keith$ rails s
=> Booting WEBrick
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-07-09 10:35:43] INFO WEBrick 1.3.1
[2015-07-09 10:35:43] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
Exiting
/Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/socket.rb:232:in `foreach'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/socket.rb:459:in `tcp_server_sockets'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/utils.rb:70:in `create_listeners'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:133:in `listen'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:114:in `initialize'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:45:in `initialize'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in `new'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in `run'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:80:in `start'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/Keith/Documents/0Coding/Rails/raddit/bin/rails:8:in `require'
from /Users/Keith/Documents/0Coding/Rails/raddit/bin/rails:8:in `<top (required)>'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `load'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `call'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/command.rb:7:in `call'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client.rb:26:in `run'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/bin/spring:48:in `<top (required)>'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `load'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Keith/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Keith/Documents/0Coding/rails/raddit/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I have tried updating all gems, rails, ruby, specific gems listed here (spring, railties, etc), i bundle installed, rake db:migrate.. I'm not too adept at rails, so any help is appreciated.
Thanks!
++kb
Check your /etc/hosts file, it's default configuration for 'localhost' needs to be -
if not try with this.
127.0.0.1 localhost
I installed the Rails installer in my Win7 machine from http://railsinstaller.org/. I already had the Ruby 1.9.2-p290. After installing the ROR through the installer, I rain rails s to start the server and I get the following error. Could anybody help me understanding the reason of this error>?
C:\Sites\ridemo>rails s
=> Booting WEBrick
=> Rails 3.1.0.rc6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0.rc6/lib/sp
rockets/railtie.rb:21:in `block (2 levels) in <class:Railtie>': undefined method
`static_root=' for #<Sprockets::Environment:0x361d178> (NoMethodError)
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/sprockets-2.0.
0/lib/sprockets/environment.rb:55:in `initialize'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `new'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `block in <class:Railtie>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:50:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `each'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/application.rb:92:in `initialize!'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Sites/ridemo/config/environment.rb:5:in `<top (required)>'
from C:/Sites/ridemo/config.ru:4:in `require'
from C:/Sites/ridemo/config.ru:4:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `initialize'
from C:/Sites/ridemo/config.ru:1:in `new'
from C:/Sites/ridemo/config.ru:1:in `<main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:200:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:46:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:301:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:252:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:70:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:54:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `tap'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
RailsInstaller now supports Rails 3.1, but promise nothing about previous RC versions. Like #Fabio said, try to update to the latest Rails version (change it in your Gemfile). Also, if you already had a ruby version installed, be sure you are using the RailsInstaller one by checking your system environment path variable. The one and only path to Ruby should be :
C:\RailsInstaller\Ruby1.9.2\bin;
needed to run the following and It resolved the problem:-
gem install rails -v=3.1.0.rc8
From (https://github.com/sstephenson/sprockets/issues/172)