1

I would like to use the mobile library for spine in Rails 3.1.0. I tried adding the following to my index.js.coffee:

#= require spine.mobile

and

#= require spine/mobile

But that both results in an error: couldn't find file

When using hem you can specify the dependencies in the slug.json file and run

npm install .

How do I install dependencies using Rails/Sprockets?

Nina
  • 23
  • 4

1 Answers1

1

Did you try using spine.mobile-rails?

Just add the following to your Gemfile:

gem 'spine.mobile-rails', :git => 'https://github.com/goyox86/spine.mobile-rails.git'

And require 'spine.mobile-rails' in your application.js.

Note that spine.js has also excellent integration with rails, via the spine-rails gem, with great scaffolding to get you started. Not sure if this is relevant for the mobile part.

nathanvda
  • 49,707
  • 13
  • 117
  • 139
  • When I add the gem to my `Gemfile` and run `bundle install` I get this error: `Could not find gem 'spine.mobile-rails (>= 0, runtime)' in any of the gem sources`. – Nina Nov 28 '11 at 13:07
  • 1
    Ah indeed: apparently the gem was never pushed to rubygems.org. You can use a gem from github, I instantly propose to use the version from goyox86, which includes the correct styling templates as well. HTH. – nathanvda Nov 28 '11 at 14:19
  • 1
    It works, thanks a lot! I didn't had to require anything in the **application.js** I just added `#= require spine/touch` to **index.js.coffee**. – Nina Nov 28 '11 at 14:45