Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opal::Server|SimpleServer|OpalSprocketsServer examples/ aren't working anymore #1831

Closed
ozpos opened this issue May 19, 2018 · 7 comments
Closed

Comments

@ozpos
Copy link

ozpos commented May 19, 2018

Hi, Could someone please indicate where opal-11 is going w.r.t. rack/sinatra/config.ru ?
Or should I just stick with 0.10.5 stable ?

Or should I just give up all-together ?

@elia
Copy link
Member

elia commented May 27, 2018

@ozpos you can combine opal and sprockets by using opal-sprockets.

For 0.11 should be enough to add:

 gem 'opal-sprockets', '~> 0.4.1'

Let me know if you have hard to solve bundle conflicts (I'll close the issue meanwhile).

@elia elia closed this as completed May 27, 2018
@ozpos
Copy link
Author

ozpos commented May 28, 2018

Been there weeks ago, just got depreciation warning saying use
Opal::Sprockets::Server - never got that to work and it breaks my
config.ru which works perfectly well with 0.10.0

Would it not be quicker for all if someone could fix the examples ?

@elia elia reopened this May 29, 2018
@elia elia changed the title Opal::Server|SimpleServer|OpalSprocketsServer - please show way ahead Opal::Server|SimpleServer|OpalSprocketsServer examples/ aren't working anymore May 29, 2018
@elia
Copy link
Member

elia commented Jun 1, 2018

@ozpos I've updated the example in opal-sprockets, let me know if you encounter any other broken examples (as always PRs are encouraged! 😉)

@ozpos
Copy link
Author

ozpos commented Jun 1, 2018

Sorry but I do not know what PRs are and sorry but the opal-sprockets example still fails for me with.

Using opal-sprockets 0.4.1.0.11.0.3.1 from source at `../`
Bundle updated!
$:~/RubymineProjects/web/opal-sprockets/example$ bundle exec rackup
Failed to load WithCLexer, using pure Ruby lexer
bundler: failed to load command: rackup (/home/xxx/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/bin/rackup)
NameError: uninitialized constant Opal::Sprockets::Server
Did you mean?  Opal::Server

Unfortunately I cannot find a single example that works against any version of opal above 0.10.5. This includes opal-jquery that you pointed me to in another issue.

Should this be communicated under opal-sprockets #10 and #12 ?

@elia
Copy link
Member

elia commented Jun 1, 2018

@ozpos the updated example is on opal-sprockets master and can be tried with these commands:

git clone https://github.com/opal/opal-sprockets.git
cd opal-sprockets/example
bundle install
rackup
# visit http://localhost:9292 with your browser

I'll publish the updated gem in the near future, meanwhile use the instructions above

@ozpos
Copy link
Author

ozpos commented Jun 1, 2018

Thanks, works now. Still do not know why it did not before.

I see that sprockets support has been in and out of opal and opal-sprockets throughout different versions of opal.

If in future sprockets are to be used through the opal-sprockets gem then should the opal gemfile also specify

sprockets_version = ENV['SPROCKETS_VERSION']

# Stick with older racc until
# https://github.com/tenderlove/racc/issues/22
# is solved.
gem 'racc', '< 1.4.10', platform: :jruby
gem 'json', '< 1.8.1',  platform: :ruby if RUBY_VERSION.to_f == 2.1
gem 'rack-test', '< 0.8' if RUBY_VERSION.to_f <= 2.0
gem 'rubysl', platform: :rbx
gem 'coveralls', platform: :mri
gem 'puma' # Some browsers have problems with WEBrick
gem 'rack', rack_version if rack_version
gem 'tilt', tilt_version if tilt_version
gem 'sprockets', sprockets_version if sprockets_version

sprockets directly ?

@elia
Copy link
Member

elia commented Jun 1, 2018

you should put both opal and opal-sprockets in your gemfile, but you only need to specify the opal version.

gem 'opal', '~> 0.11.0'
gem 'opal-sprockets'

similar to the example in the opal-sprockets repo: https://github.com/opal/opal-sprockets/blob/32cde8638159a41ae10fbde2fe06f844451ff540/example/Gemfile


ps. by PRs I mean pull-requests, sorry for the confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants