innoq / iqvoc

iQvoc - A SKOS(-XL) Vocabulary Management System for the Semantic Web
http://iqvoc.net/
Other
115 stars 44 forks source link

Using iqvoc as a rails engine, template doesn't apply? #393

Open ldodds opened 6 years ago

ldodds commented 6 years ago

I'm unclear about how to go about starting a new rails project using iqvoc as an engine.

With Rails 5.2.0 installed if I follow the commands in the documentation to download the template and then apply it:

rails new iqvoc_sample -m template.rb

The generated project doesn't have any obvious iqvoc additions, e.g. no app/assets/javascripts/manifest.js file as created in the template. And no rake commands as noted here.

Downgrading to Rails 4.2.0 and running again, I end up with

The template [/home/ldodds/workspaces/openactive/template.rb] could not be loaded. Error: No such file or directory @ rb_sysopen - /home/ldodds/workspaces/openactive/iqvoc_foobar/config/initializers/session_store.rb

If I want to create a rails application that uses iqvoc functionality, but which has a customised UI, can you clarify the steps to achieve that?

ldodds commented 6 years ago

Generating a new vanilla Rails app, then adding gem 'iqvoc' results in this when i run bundler:

Fetching gem metadata from https://rubygems.org/................
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "nokogiri":
  In snapshot (Gemfile.lock):
    nokogiri (= 1.8.4)

  In Gemfile:
    capybara (< 4.0, >= 2.15) was resolved to 3.4.1, which depends on
      nokogiri (~> 1.8)

    capybara (< 4.0, >= 2.15) was resolved to 3.4.1, which depends on
      nokogiri (~> 1.8)

    capybara (< 4.0, >= 2.15) was resolved to 3.4.1, which depends on
      nokogiri (~> 1.8)

    iqvoc was resolved to 4.11.0, which depends on
      nokogiri (~> 1.6.0)

    rails (~> 5.2.0) was resolved to 5.2.0, which depends on
      actionpack (= 5.2.0) was resolved to 5.2.0, which depends on
        rails-html-sanitizer (>= 1.0.2, ~> 1.0) was resolved to 1.0.4, which depends on
          loofah (>= 2.2.2, ~> 2.2) was resolved to 2.2.2, which depends on
            nokogiri (>= 1.5.9)

    rails (~> 5.2.0) was resolved to 5.2.0, which depends on
      actionmailer (= 5.2.0) was resolved to 5.2.0, which depends on
        rails-dom-testing (~> 2.0) was resolved to 2.0.3, which depends on
          nokogiri (>= 1.6)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "rails":
  In snapshot (Gemfile.lock):
    rails (= 5.2.0)

  In Gemfile:
    rails (~> 5.2.0)

    iqvoc was resolved to 3.2.3, which depends on
      rails (~> 3.0.9)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
ldodds commented 6 years ago

Any suggestions appreciated. I'm keen to explore customising iqvoc for a project.

I have the source code checked out and running locally to confirm the tools meets my requirements. But want to explore using as an engine rather than creating a fork as I think that will be harder to maintain.

philippneugebauer commented 6 years ago

As bundler tells you, iqvoc does not work with Rails > 4.2

If you need it, we are happy to accept a PR :)

ldodds commented 6 years ago

@philippneugebauer I don't need higher than 4.2 but I can't get it to work with that version either.

I downgraded to Rails 4.2.0, downloaded the template and tried to generate an app. I ended up with

The template [/home/ldodds/workspaces/openactive/template.rb] could not be loaded. Error: No such file or directory @ rb_sysopen - /home/ldodds/workspaces/openactive/iqvoc_foobar/config/initializers/session_store.rb

Editing the template to remove reference to the missing file got me as far as bundler, which then failed because of another issue :/

It would be useful to know if the problem with the template occurs for anyone else, then I know it must be some combination of gem/bundler versions.

philippneugebauer commented 6 years ago

I didn't have this problem, when I set up a new iQvoc few weeks ago.

ldodds commented 5 years ago

Returned to try this again.

$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
$ rails -v
Rails 4.2.0
$ bundler -v
Bundler version 1.15.4

The bundle install after applying the template fails with:

Gem::InstallError: cancancan requires Ruby version >= 2.2.0.
An error occurred while installing cancancan (2.3.0), and Bundler cannot continue.
Make sure that `gem install cancancan -v '2.3.0'` succeeds before bundling.

I tried using Ruby 2.1 as that's whats noted in README.

Retrying:

$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ rails -v
Rails 4.2.0
$ bundler -v
Bundler version 1.16.6

Generating the application fails after the bundle install with:

         run  bundle exec spring binstub --all
/home/ldodds/.rvm/gems/ruby-2.2.0/gems/bundler-1.16.6/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find nokogiri-1.7.2 in any of the sources (Bundler::GemNotFound)

I've also tried checking out the sample app, but that fails to run.

I'm really keen to trial iqvoc for an application, I can proceed with creating a fork to test a proof-of-concept, but would be interested to know what combination of rails, ruby, bundler versions plus any other changes that people have found successful.

paulwalk commented 5 years ago

@philippneugebauer I don't need higher than 4.2 but I can't get it to work with that version either.

I downgraded to Rails 4.2.0, downloaded the template and tried to generate an app. I ended up with

The template [/home/ldodds/workspaces/openactive/template.rb] could not be loaded. Error: No such file or directory @ rb_sysopen - /home/ldodds/workspaces/openactive/iqvoc_foobar/config/initializers/session_store.rb

Editing the template to remove reference to the missing file got me as far as bundler, which then failed because of another issue :/

It would be useful to know if the problem with the template occurs for anyone else, then I know it must be some combination of gem/bundler versions.

Yes - I have reproduced this problem. I cannot get the engine template to work.