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

undefined method `mappings' for Tilt:Module #48

Closed
lcorsini opened this issue Nov 12, 2017 · 21 comments · Fixed by #49
Closed

undefined method `mappings' for Tilt:Module #48

lcorsini opened this issue Nov 12, 2017 · 21 comments · Fixed by #49
Assignees
Milestone

Comments

@lcorsini
Copy link

I've installed dashing-icinga2 today, on an ubuntu 16.04 openvz
I've followed install instructions, but when I try to open the dashboard I get this sinatra error page:

NoMethodError at /icinga2
undefined method `mappings' for Tilt:Module
file: dashing.rb location: tilt_html_engines line: 151

Previously I've installed this on a RedHat 7 machine without issues, so I don't know if is an ubuntu issue (and sadly I don't have access to the rh7 machine anymore)

  • Dashing version (gem list --local dashing):
    dashing (1.3.2)

  • Ruby version (ruby -V):
    ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

  • Version of this project (tarball name, tag name or git show -1):
    commit ccb6e03
    Merge: 14bc597 c800bfd
    Author: Michael Friedrich michael.friedrich@icinga.com
    Date: Fri Oct 6 11:15:28 2017 +0200

    Merge pull request Render Undhandled Problems green if count is zero #45 from Icinga/feature/simplemon-green-if-zero

    Render Undhandled Problems green if count is zero

  • Modifications to this project, if any (git diff):

  • Operating System and version:
    Ubuntu 16.04
    Linux watcher 2.6.32-042stab117.14 Update README.md #1 SMP Tue Aug 30 17:12:57 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux

  • Client browser and version:
    Chrome 61

@urbels
Copy link

urbels commented Nov 13, 2017

same for me

@dnsmichi
Copy link
Collaborator

Sounds like a Ruby version issue, in relation with Sinatra. Google does not make me happy, maybe the gem install pulls in a "too new" version or something like that.

@urbels
Copy link

urbels commented Nov 13, 2017

So you suggest to downgrade ruby version?

@dnsmichi
Copy link
Collaborator

To be honest, I think this is a Dashing issue itself, nothing directly related to this dashboard. I don't have the time to reproduce the issue, so I'd suggest looking for possible influences.

As remarked above, RHEL7 uses a different version of Ruby and presumingly gems which are pulled with bundle install.

You can test-drive Dashing inside the icinga-vagrant boxes, there's CentOS 7 inside. Compare the pulled gems and versions with your Ubuntu setup, and dig into possible Google results from this error. Maybe you need to pin a specific gem version, or use a different Ruby version.

@lcorsini
Copy link
Author

RHEL7 (or centos, which I've checked now) ships ruby 2.0.0
Ubuntu ships ruby 2.3.1
so maybe there are differences
I'll try to use RVM to see if I can install ruby 2.0.0

@lcorsini
Copy link
Author

I've installed RVM and used ruby 1.9.3
Same error
2017-11-13 16:32:34 - NoMethodError - undefined method mappings' for Tilt:Module: /home/lucac81/.rvm/gems/ruby-1.9.3-p551/gems/dashing-1.3.2/lib/dashing.rb:151:in tilt_html_engines'

@dnsmichi
Copy link
Collaborator

I'm wondering why you use dashing 1.3.2 ... I've seen dashing 1.3.7 on rubygems.

$ gem search dashing

*** REMOTE GEMS ***

dashing (1.3.7)

According to their release page, 1.3.2 is more than 4 years old.

@dnsmichi
Copy link
Collaborator

Hehe, first entry on google.

Shopify/dashing#581 (comment)

@lcorsini
Copy link
Author

lcorsini commented Nov 13, 2017

it gets downloaded from bundler when I run bundle inside dashing directory
if I upgrade and remove it I get this error
./restart-dashing
Could not find dashing-1.3.2 in any of the sources
Run bundle install to install missing gems.

This is what gets installed running bundle
Using backports 3.10.3
Using bundler 1.16.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using concurrent-ruby 1.0.5
Using daemons 1.2.5
Using rack 1.6.8
Using thread_safe 0.3.6
Using tzinfo 1.2.4
Using rufus-scheduler 2.0.24
Using sass 3.4.25
Using rack-protection 1.5.3
Using tilt 2.0.8
Using sinatra 1.4.8
Using multi_json 1.12.2
Using rack-test 0.7.0
Using sinatra-contrib 1.4.7
Using sprockets 3.7.1
Using eventmachine 1.2.5
Using thin 1.7.2
Using thor 0.20.0
Using dashing 1.3.2
Using unf_ext 0.0.7.4
Using unf 0.1.4
Using domain_name 0.5.20170404
Using http-cookie 1.0.3
Using json 2.1.0
Using mime-types 2.99.3
Using netrc 0.11.0
Using rest-client 1.8.0

@urbels
Copy link

urbels commented Nov 13, 2017

ye bundle installs 1.3.2:
bundle info dashing

  • dashing (1.3.2)

Edit: I edited by hand Gemfile.lock to add 1.3.7, then ran bundle update dashing and it updated, but same error.

@dnsmichi
Copy link
Collaborator

Hm, so "something" where the dashing gem has a dependency onto, is locking its version where bundle can only install 1.3.2 and not a newer version. Would be interesting to see which other gems you've installed on Ubuntu, preventing an upgrade.

@urbels
Copy link

urbels commented Nov 13, 2017

Ah nevermind it doesnt updated because:
Bundler attempted to update dashing but its version regressed from 1.3.7 to 1.3.2

@urbels
Copy link

urbels commented Nov 13, 2017

finally fixed.

@lcorsini Delete Gemfile.lock.
Edit Gemfile like this:
gem 'dashing', '1.3.7'

And run bundle and then ./restart-dashing

@dnsmichi
Copy link
Collaborator

Interesting, thanks. Let me know whether this should be included upstream in the Gemfile file. Note: Should be tested with CentOS7 inside the Vagrant box too. @bodsch any other thoughts?

@urbels
Copy link

urbels commented Nov 13, 2017

As I found in another issue, they suggest to add versions to Gemfile.

@bodsch
Copy link
Contributor

bodsch commented Nov 13, 2017

you find it out, no ruby issue. :)
I use an old (2.1) and bleeding edge (2.4) ruby and both are working fine.

1.3.7 is the latest dashing release: https://rubygems.org/gems/dashing and should be work.

i use in my projects smashing (a fork of dashing)

i think, it is better, to define a version into the Gemfile:

gem 'dashing', '~> 1.3'

@dnsmichi
Copy link
Collaborator

~> 1.3 won't solve the issue, as this allows for >= 1.3.0 && < 1.4.0. I think we need to explicitly require the latest release from rubygems.org. Other locations won't use the Gemfile anyway. What do you think?

@lcorsini
Copy link
Author

Ok with explicit version of dashing in Gemfile it works correctly
Strange that by without explicit version, 1.3.2 gets pulled out.
BTW searching for this problem I found that dashing isn't developed anymore, but there is a replacement called smashing, isn't better to move to that project? or is no big deal at the moment?

@dnsmichi
Copy link
Collaborator

As said, I think that bundler evaluates all dependencies and comes to the conclusion that the lowest version satisfies the needs. I don't know all the Ruby internals and package handling, especially not with bundler. Just a guess from that current problem.

The changes in smashing compared to current dashing master are nearly zero, except for tests and docs. The hassle with upgrading and renaming is way too much imho, unless there are real improvements, such as full Windows support.

Btw - dashing is a common name you'll reference with a dashboard. smashing - I would not relate this to a dashboard if I were new. Going the route of leaving the project name intact, but requiring smashing for dashing - I will not take the effort to answer all community questions on that.

TL;DR - I think dashing works quite well in its current form. It definitely is not something one can maintain without some programming knowledge, even if it looks super easy. The entry of creating your own dashboards is super hard. Which is why I wrote development docs.

@bodsch
Copy link
Contributor

bodsch commented Nov 14, 2017

i'm absolut conform with @dnsmichi.

it doesn't matter which packet you use.
the develpment of dashing is stopped. since years.
smashing - as fork - too? I dont know.
but both works well.

@dnsmichi dnsmichi self-assigned this Nov 14, 2017
@dnsmichi dnsmichi added this to the 1.4.0 milestone Nov 14, 2017
dnsmichi pushed a commit that referenced this issue Nov 20, 2017
fixes #48

Also fixes the new problem on CentOS/RHEL 7 with a new release of
rack-test now requiring Ruby 2.2.2. This is a recursive dependency
of rack-protection pulled from sinatra pulled from dashing.

rack-protection requires rack-test >= 0.

This fails:

```
Gem::InstallError: rack-test requires Ruby version >= 2.2.2.
```
@dnsmichi
Copy link
Collaborator

Found another problem on RHEL7 with dashing -> sinatra -> rack-protection -> rack-test -> Ruby >= 2.2.2 - will fix both.

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

Successfully merging a pull request may close this issue.

4 participants