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

Decouple Chartkick from Railties? #10

Closed
dannguyen opened this issue May 15, 2013 · 5 comments
Closed

Decouple Chartkick from Railties? #10

dannguyen opened this issue May 15, 2013 · 5 comments

Comments

@dannguyen
Copy link

I was hoping to use Chartkick with Padrino, which is a Sinatra-based framework that can be made Rails-like by including ActiveRecord, ActiveSupport, etc.

However, Chartkick won't run without Rack 1.4.5. Padrino requires Rack 1.5, and so I'm getting this error:

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    chartkick (>= 0) ruby depends on
      rack (~> 1.4.5) ruby

Haven't had a chance to play with Chartkick but it seems like it's something that could run with just ActiveRecord, just like the geocoder gem (https://github.com/alexreisner/geocoder)?

@ankane
Copy link
Owner

ankane commented May 16, 2013

I'll see if I can get it working with Padrino. Don't think it'll be too difficult.

@ankane
Copy link
Owner

ankane commented May 16, 2013

Try the padrino branch https://github.com/ankane/chartkick/tree/padrino

@dannguyen
Copy link
Author

Danke! Will let you know how it works

@dannguyen
Copy link
Author

A couple of Padrino specific notes:

  1. In the Gemfile, padrino must be listed before the chartkick gem or else you'll get this:

       /gems/ruby-1.9.3-head@trawl/bundler/gems/chartkick-54f1691b76f7/lib/chartkick/padrino.rb:2:in `<class:Application>': undefined method `helpers' for Padrino::Application:Class (NoMethodError)
    
  2. The Padrino helper javascript_include_tag has apparently a different implementation than in Rails, because:

    <%= javascript_include_tag "//www.google.com/jsapi"%>
    

Resolves to:

   <script src="//www.google.com/jsapi.js" type="text/javascript"></script>

i.e. it wrongly assumes that the call should include the .js extension...This can be "fixed" by prepending the scheme (e.g. https:). Obviously, not chartkick's concern, but just a note for anyone trying to follow the README exactly.

@ankane
Copy link
Owner

ankane commented May 28, 2013

Awesome, thanks for the detailed notes! I'll be sure to add them to the readme before this is merged.

@ankane ankane closed this as completed Jun 5, 2013
@lock lock bot locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants