GithubHelp home page GithubHelp logo

Comments (2)

zw963 avatar zw963 commented on July 1, 2024

Add rake into Gemfile fix this.

I am wonder why seldom to see add `rake' into Gemfie, anywhy, it worked.

from opal-rspec.

zw963 avatar zw963 commented on July 1, 2024

@elia ,
This issue still happen in Opal 0.11, we have to add rake with opal-rspec together into Gemfile, to make opal-rspec to work.

Following is a simple example:

# Gemfile

source 'https://rubygems.org'

# gem 'rake'
gem 'opal'
gem 'opal-sprockets', require: false
gem 'opal-jquery', github: 'opal/opal-jquery'
gem 'opal-rspec
# config.ru

require 'bundler'
Bundler.require

require 'opal/sprockets/server'

run Opal::Sprockets::Server.new {|s|
  s.append_path 'app'
  s.append_path 'js'
  s.main = 'application'

  # This can be used to provide a custom index file.
  s.index_path = 'index.html.erb'
}

When I run rackup in project root, got:

/home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/post_rack_locator.rb:1:in `require': cannot load such file -- rake (LoadError)
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/post_rack_locator.rb:1:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/cached_environment.rb:2:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/cached_environment.rb:2:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/sprockets_environment.rb:3:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec/sprockets_environment.rb:3:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec.rb:4:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal/rspec.rb:4:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal-rspec.rb:1:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/opal-rspec-0.6.1/lib/opal-rspec.rb:1:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require'
        from /home/zw963/.rvm/gems/ruby-2.3.3@global/gems/bundler-1.14.6/lib/bundler.rb:107:in `require'
        from /home/public/Dropbox/others/Project/opal/0.10.5/conway_gol/config.ru:2:in `block in <main>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
        from /home/public/Dropbox/others/Project/opal/0.10.5/conway_gol/config.ru:in `new'
        from /home/public/Dropbox/others/Project/opal/0.10.5/conway_gol/config.ru:in `<main>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/server.rb:319:in `build_app_and_options_from_config'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/server.rb:219:in `app'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/server.rb:354:in `wrapped_app'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/server.rb:283:in `start'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/lib/rack/server.rb:148:in `start'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/gems/rack-2.0.3/bin/rackup:4:in `<top (required)>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/bin/rackup:22:in `load'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/bin/rackup:22:in `<main>'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/bin/ruby_executable_hooks:15:in `eval'
        from /home/zw963/.rvm/gems/ruby-2.3.3@conway_gol/bin/ruby_executable_hooks:15:in `<main>'

Thought this issue could be resolved by add gem 'rake' into my Gemfile, but, this annoy me a lot
for me, i think same situation for those newbie to Opal.

Anywhy, i think this could be resolved by opal-rspec, right?

Following is my example project: https://github.com/zw963/conway_gal

from opal-rspec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.