react-sinatra
react-sinatra copied to clipboard
Example app not working as expected
I really like your project but i do not understand how to make it work properly. I'm trying your basic tutorial https://github.com/namusyaka/react-sinatra-sample But i think something is wrong.
Steps to Reproduce the Problem
- Hitting http://localhost:4567/ print out this is an example for react-siantra as expected
- Hitting http://localhost:4567/react-component print out "{"name":"namusyaka"}"}"> (adding a parameter to the request namusyaka changes as expected) the page body content is the following: <div data="{:react_class=>" commentbox",="" :react_props="">"{"name":"namusyaka"}"}">
- Hitting http://localhost:4567/react-component-with-server print out the following error: [2018-08-13 14:21:27] INFO WEBrick::HTTPServer#start: pid=24271 port=4567 2018-08-13 14:21:32 - NoMethodError - undefined method `concat' for #React::Sinatra::Component:0x0000000001530ce0 Did you mean? concern:
Specifications
- Version: Ruby ruby 2.3.7p456, Sinatra 1.4.7, react-sinatra 0.1.1, Node v6.11.3
- Platform: Linux/ Ubuntu 14.04.5
Many thanks
Strange. Couldn't reproduce in my locally. Could you try to upgrade ruby version into 2.4.X?
I've updated ruby to version ruby 2.4.4p296 (2018-03-28 revision 63013) Now, when i execute bundle exec ruby app.rb i get some warning messages:
/home/matteog/.rvm/gems/ruby-2.4.4@padrino/gems/sinatra-1.4.7/lib/sinatra/base.rb:1226: warning: constant ::Fixnum is deprecated /home/matteog/.rvm/gems/ruby-2.4.4@padrino/gems/sinatra-1.4.7/lib/sinatra/base.rb:1226: warning: constant ::Fixnum is deprecated /home/matteog/.rvm/gems/ruby-2.4.4@padrino/gems/sinatra-1.4.7/lib/sinatra/base.rb:1226: warning: constant ::Fixnum is deprecated /home/matteog/.rvm/gems/ruby-2.4.4@padrino/gems/sinatra-1.4.7/lib/sinatra/base.rb:1226: warning: constant ::Fixnum is deprecated /home/matteog/.rvm/gems/ruby-2.4.4@padrino/gems/sinatra-1.4.7/lib/sinatra/base.rb:1226: warning: constant ::Fixnum is deprecated
However the final result is the same. (http://localhost:4567/react-component-with-server)

http://localhost:4567/react-component

@namusyaka I'm also reproing the undefined method 'concat' error on ruby v2.5.0
The problem seems to be specifically with react-sinatra 0.1.1; 0.1.0 works fine.
hi @Hamms Could you tell me exactly what versions of Sinatra, react on rails etc.. you are on? I'm running into the same exact issue and tried to upgrade to 2.50 + react sinatra 0.1.0 -> I still get the concat issue.
I just ran into this problem today. I pinned padrino-helpers to version 0.14.4 to fix it.
No idea what version broke the functionality, I just had a working copy on that version.