Smashing / smashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.
https://smashing.github.io/
MIT License
3.22k stars 324 forks source link

TypeError - can't dup NilClass: #123

Closed qpac closed 5 years ago

qpac commented 5 years ago

Hello I have smashing install of raspberry pi 3b+ with the newest raspbian-stretch. when I enter the following in bash:

curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://localhost:3030/widgets/welcome

the following error occurs:

TypeError: can't dup NilClass /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1092:in dup' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1092:inblock in dispatch!' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1092:in each' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1092:indispatch!' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:924:in block in call!' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:inblock in invoke' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:in catch' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1076:ininvoke' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:924:in call!' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:913:incall' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/xss_header.rb:18:in call' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/path_traversal.rb:16:incall' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/json_csrf.rb:26:in call' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/base.rb:50:incall' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/base.rb:50:in call' /var/lib/gems/2.3.0/gems/rack-protection-2.0.5/lib/rack/protection/frame_options.rb:31:incall' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/logger.rb:15:in call' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/common_logger.rb:33:incall' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:231:in call' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:224:incall' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/head.rb:12:in call' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:incall' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/show_exceptions.rb:22:in call' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:194:incall' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1957:in call' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:inblock in call' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1729:in synchronize' /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1502:incall' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in block in call' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:ineach' /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in call' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/connection.rb:86:inblock in pre_process' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/connection.rb:84:in catch' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/connection.rb:84:inpre_process' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/connection.rb:53:in process' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/connection.rb:39:inreceive_data' /var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in run_machine' /var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:inrun' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/backends/base.rb:73:in start' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/server.rb:162:instart' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/controllers/controller.rb:87:in start' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/runner.rb:203:inrun_command' /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/runner.rb:159:in run!' /var/lib/gems/2.3.0/gems/thin-1.7.2/bin/thin:6:in<top (required)>' /usr/local/bin/thin:22:in load' /usr/local/bin/thin:22:in<top (required)>' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in load' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:inkernel_load' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in run' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:463:inexec' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:ininvoke_command' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:27:indispatch' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:18:instart' /var/lib/gems/2.3.0/gems/bundler-2.0.1/exe/bundle:30:in block in <top (required)>' /var/lib/gems/2.3.0/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:inwith_friendly_errors' /var/lib/gems/2.3.0/gems/bundler-2.0.1/exe/bundle:22:in <top (required)>' /usr/local/bin/bundle:22:inload'

What is my problem ???

kinow commented 5 years ago

Can't really help. It worked for me with smashing vanilla install on Ubuntu LTS.

image

Even tried to use same sinatra version as you (both sinatra and sinatra-contrib). But it still worked. Ruby 2.5 on Ubuntu LTS.

$ gem list

*** LOCAL GEMS ***

activesupport (5.2.2)
addressable (2.5.2)
autoprefixer-rails (9.4.4)
backports (3.11.3)
bigdecimal (default: 1.3.4)
bootstrap (4.1.3)
buftok (0.2.0)
bundler (2.0.1, 1.16.1)
cmath (default: 1.0.0)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
colorator (1.1.0)
concurrent-ruby (1.1.4, 1.0.5)
csv (default: 1.0.0)
daemons (1.2.6)
date (default: 1.0.0)
dbm (default: 1.0.0)
did_you_mean (1.2.0)
docile (1.1.5)
domain_name (0.5.20180417)
em-websocket (0.5.1)
equalizer (0.0.11)
et-orbi (1.1.1)
etc (default: 1.0.0)
eventmachine (1.2.7)
execjs (2.7.0)
extras (0.3.0)
fakeweb (1.3.0)
fastimage (2.1.5)
fcntl (default: 1.0.0)
ffi (1.9.25)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
forwardable-extended (2.6.0)
gdbm (default: 2.0.0)
haml (5.0.4)
http (3.3.0)
http-cookie (1.0.3)
http-form_data (2.1.1)
http_parser.rb (0.6.0)
i18n (0.9.5)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
jekyll (3.8.4)
jekyll-assets (3.0.12)
jekyll-feed (0.11.0)
jekyll-jupyter-notebook (0.0.4)
jekyll-sanity (1.2.0)
jekyll-sass-converter (1.5.2)
jekyll-watch (2.1.2)
json (default: 2.1.0)
kramdown (1.17.0)
liquid (4.0.1)
liquid-tag-parser (1.9.0)
listen (3.1.5)
memoizable (0.4.2)
mercenary (0.3.6)
metaclass (0.0.4)
mini_portile2 (2.4.0)
minitest (5.11.3, 5.10.3)
mocha (1.2.1)
multi_json (1.13.1)
multipart-post (2.0.0)
mustermann (1.0.2)
naught (1.1.0)
net-telnet (0.1.1)
nokogiri (1.9.1)
openssl (default: 2.1.0)
pathutil (0.16.2)
popper_js (1.14.5)
power_assert (0.2.7)
psych (default: 3.0.2)
public_suffix (3.0.3)
rack (2.0.6, 2.0.5)
rack-protection (2.0.5, 2.0.1)
rack-test (0.6.3)
rake (12.3.1, 12.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rdoc (default: 6.0.1)
rouge (3.3.0)
ruby_dep (1.5.0)
rufus-scheduler (3.4.2)
safe_yaml (1.0.4)
sass (3.7.2, 3.4.25)
sass-listen (4.0.0)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
simple_oauth (0.3.1)
simplecov (0.14.1)
simplecov-html (0.10.2)
sinatra (2.0.5)
sinatra-contrib (2.0.5, 2.0.1)
smashing (1.1.0)
sprockets (3.7.2, 3.7.1)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
temple (0.8.0)
test-unit (3.2.5)
thin (1.7.2)
thor (0.20.3, 0.19.4)
thread_safe (0.3.6)
tilt (2.0.8)
twitter (6.2.0)
tzinfo (1.2.5)
unf (0.1.4)
unf_ext (0.0.7.5)
webrick (default: 1.4.2)
zlib (default: 1.0.0)
MiskonceptioN commented 5 years ago

I'm getting the same thing so would love some help on this.

Installed on OS X 10.13.6

MiskonceptioN commented 5 years ago

@qpac I managed to fix it!

The version of Ruby bundled with OS X is seemingly incompatible, so I updated to the latest version, restarted my machine, restarted the dashboard, then I could curl and update the dashboard.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile source ~/.bash_profile

# Install Ruby rbenv install 2.6.1 rbenv global 2.6.1 ruby -v

Then restart, launch your dashboard, and you should be good to go!

kinow commented 5 years ago

@qpac see @MiskonceptioN 's comment. I couldn't reproduce it on Ubuntu LTS' Ruby and smashing. Feel free to re-open if that doesn't work for you. And thanks for reporting the fix for the issue @MiskonceptioN !