Rails 4.1 secrets.yml error - ruby-on-rails

Just upgraded to Rails 4.1 and am using secrets.yml.
This is what it looks like:
development:
secret_key_base: akshdakjshdgakjhsdgakjdhgaskjdhgaskjdhgska
test:
secret_key_base: somelegitlongasskeygeneratedbyrakesecrethere
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
When I restart my server and visit any page, in my browser I get an "Internal Server Error".
In my log file, I see this:
$ rails s
=> Booting Thin
=> Rails 4.1.0 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
Thin web server (v1.6.2 codename Doc Brown)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
Unexpected error while processing request: (<unknown>): found character that cannot start any token while scanning for the next token at line 14 column 1
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:15:in `load_with_options'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:313:in `secrets'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:439:in `validate_secret_key_config!'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:195:in `env_config'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/engine.rb:510:in `call'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:144:in `call'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/server.rb:69:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Unexpected error while processing request: (<unknown>): found character that cannot start any token while scanning for the next token at line 14 column 1
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:15:in `load_with_options'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:313:in `secrets'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:439:in `validate_secret_key_config!'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:195:in `env_config'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/engine.rb:510:in `call'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/application.rb:144:in `call'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/.rvm/gems/ruby-2.0.0-p353#global/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/server.rb:69:in `start'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
/.rvm/gems/ruby-2.0.0-p353#my_project/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Any thoughts on what could be causing this?
I tried multiple iterations of the secrets.yml file, to even enclose the secret_key_base in single quotations like 'somelongasskeyhere' but that didn't work.
Update 1
So it seems the issue may be with how finnicky YAML is. I think it has something to do with the spacing & tabs I put in, but I just can't seem to get it perfect. Now I am getting another error at a different position in the line.
After re-doing some of the spaces to just use the spacebar 4 times, versus the tab - which was set at 4 spaces, I am now getting a different error:
Unexpected error while processing request: (<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 13 column 3
Which references this line:
development:
secret_key_base:'86bc42f97803818b48ff88ef15d9d4df6b6b4e4e723c119967a29751de33b5687af3a57542b4a8364cb3d6b51a872ad1188b9de6f0faab578272451aa798956c'
Update 2
It definitely is something to do with my spacing, because once I copied and pasted this file - https://github.com/RailsApps/rails-devise/blob/master/config/secrets.yml - into mine and just replaced the key_base with mine, everything worked just fine.

Related

Ruby server does not start / No such file or directory

rails s -p 3001
=> Booting Puma
=> Rails 6.1.4.4 application starting in development
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.6.0 (ruby 2.6.9-p207) ("Birdie's Version")
* Min threads: 5
* Max threads: 5
* Environment: development
* PID: 86165
* Listening on http://127.0.0.1:3001
* Listening on http://[::1]:3001
Exiting
/Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/puma/launcher.rb:248:in `write': No such file or directory # rb_sysopen - /var/run/puma/my_app.sock (Errno::ENOENT)
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/puma/launcher.rb:248:in `write_pid'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/puma/launcher.rb:112:in `write_state'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/puma/single.rb:48:in `run'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/puma/launcher.rb:182:in `run'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/puma-5.6.0/lib/rack/handler/puma.rb:72:in `run'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/rack-2.2.3/lib/rack/server.rb:327:in `start'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/commands/server/server_command.rb:39:in `start'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/commands/server/server_command.rb:144:in `block in perform'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/commands/server/server_command.rb:135:in `tap'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/commands/server/server_command.rb:135:in `perform'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/command/base.rb:69:in `perform'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/command.rb:48:in `invoke'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/railties-6.1.4.4/lib/rails/commands.rb:18:in `<main>'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /Users/kadri/code/goconf-api/bin/rails:5:in `<top (required)>'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/client/rails.rb:30:in `load'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/client/rails.rb:30:in `call'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/client/command.rb:7:in `call'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/client.rb:30:in `run'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/bin/spring:49:in `<top (required)>'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/binstub.rb:11:in `load'
from /Users/kadri/.rvm/gems/ruby-2.6.9/gems/spring-3.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/kadri/code/goconf-api/bin/spring:10:in `require'
from /Users/kadri/code/goconf-api/bin/spring:10:in `block in <top (required)>'
from /Users/kadri/code/goconf-api/bin/spring:7:in `tap'
from /Users/kadri/code/goconf-api/bin/spring:7:in `<top (required)>'
from bin/rails:2:in `load'
from bin/rails:2:in `<main>'
It seems you have configured in your config/puma.rb file that the Puma application server should listed to a UNIX socket in /var/run/puma/my_app.sock
However, the directory /var/run/puma likely doesn't exist on your Mac (and if it doesn't you likely have no permissions to write there).
As such, you could edit your config/puma.rb file and remove the unix socket bind there or adapt it to a "normal" TCP bind. Possibly, you could also use environment variables instead depending on your actual code in that file.

Rails Server keeps exiting on "rails server" command

Here are my specs: Ruby 2.4.0, Rails 5.1.3, postgres 9.6, windows 10 running rails with Bash Ubuntu. Whenever I try running rails server it exits me, I'm at the root of the project. It wasn't happening before. Here are the gems I recently installed: boostrap-sass, devise, toastr-rails, omniauth, omniauth-facebook
rails server
=> Booting Puma
=> Rails 5.1.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:228:in `mkdir': File exists # dir_s_mkdir - /mnt/c/Users/xxxxx/Desktop/xxxxx/tmp/pids (Errno::EEXIST)
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:228:in `fu_mkdir'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:206:in `block (2 levels) in mkdir_p'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:204:in `reverse_each'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:204:in `block in mkdir_p'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:190:in `each'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:190:in `mkdir_p'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:75:in `block in create_tmp_directories'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:74:in `each'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:74:in `create_tmp_directories'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:40:in `start'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:131:in `block in perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `tap'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Remove the folder or file /mnt/c/Users/xxxxx/Desktop/xxxxx/tmp/pids and try again?

rails server error `initialize': getaddrinfo: Name or service not known (SocketError)

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"

Unexpected error while processing request: invalid byte sequence in UTF-8 #

when enable rack-mini-profiler gem, it gives error
Unexpected error while processing request: invalid byte sequence in UTF-8
using
Rails v4.0.6
rack-mini-profiler 0.10.1
Ruby 2.2.0
only happen if enable rake-mini-profiler, otherwise application working fine.
backtrace:
Unexpected error while processing request: invalid byte sequence in UTF-8
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/client_settings.rb:24:in `split'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/client_settings.rb:24:in `initialize'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:153:in `new'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:153:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/engine.rb:511:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/application.rb:97:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/content_length.rb:14:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `catch'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:53:in `process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
/home/aa/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run_machine'
/home/aa/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/server.rb:162:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/handler/thin.rb:16:in `run'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:264:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands/server.rb:84:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:76:in `block in <top (required)>'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:71:in `tap'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:71:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
I'm not sure, i think this error keep coming after 'Slim-Rails' gem
just added
gem "handle_invalid_percent_encoding_requests"
working fine !
solution from https://stackoverflow.com/a/24894410/3212137

Websocket Rails deadlocking issue

Having an issue in a Rails 4 app where I'm getting a deadlock error (details below). I'm using the 'websocket-rails' gem.
It seems to be happening on every 2nd request, coming from dispatcher = new WebSocketRails('localhost:3000/websocket'); (from the front-end of my app)
I've seen little to no mention of this issue except for an older issue within the faye repo on github: https://github.com/faye/faye/issues/190
Error:
Started GET "/websocket" for 127.0.0.1 at 2014-10-20 00:26:38 -0700
#<ActionDispatch::Request:0x007fae697e4a18>
Unexpected error while processing request: deadlock; recursive locking
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:16:in `lock'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:16:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/static.rb:64:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/engine.rb:514:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:144:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/faye-websocket-0.7.5/lib/faye/adapters/thin.rb:40:in `process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/faye-websocket-0.7.5/lib/faye/adapters/thin.rb:44:in `receive_data'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/server.rb:69:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:81:in `block in server'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
/Users/userme/Desktop/rdio-client-v2/server/bin/rails:8:in `require'
/Users/userme/Desktop/rdio-client-v2/server/bin/rails:8:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/userme/Desktop/rdio-client-v2/server/bin/spring:16:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Adding
config.middleware.delete Rack::Lock
to application.rb should help.

Resources