spine / spine-rails

Spine plugin for Rails
171 stars 38 forks source link

couldn't find file 'json2' #31

Closed paglias closed 11 years ago

paglias commented 12 years ago

Hi!

I've followed the instructions on the readme but when opening http://localhost:3000/posts I get an error from Sprockets telling me that it couldn't find json2, the file is that:

assets/javascript/app/index.js.coffe

#= require json2
#= require jquery
#= require spine
#= require spine/manager
#= require spine/ajax
#= require spine/route

#= require_tree ./lib
#= require_self
#= require_tree ./models
#= require_tree ./controllers
#= require_tree ./views

class App extends Spine.Controller
  constructor: ->
    super

    # Initialize controllers:
    #  @append(@items = new App.Items)
    #  ...

    Spine.Route.setup()    

window.App = App
paglias commented 12 years ago

removing the line about json2 it tells the same error for spine

harryhorn commented 12 years ago

Hi,

Had the same issue. The file is installed with the spine-rails gem but you need to restart your rails server after you generate the new spine app. Try restarting and then reloading the browser. Worked for me.

Harry

whatyoubendoing commented 11 years ago

This is no longer an issue spine-rails now uses the json2-rails gem.

jcarlson commented 11 years ago

I just upgraded to spine-rails v0.1.1 and ran into this same issue. Even though spine-rails brings in json2-rails as a transitive dependency, I had to explicitly declare json2-rails in my Gemfile and add it to the 'assets' group for things to work properly.

gem 'json2-rails', '~> 1.0.0', :group => [:assets]

Has anyone else run into this? Or did I do something wrong? My Spine app looks pretty much like the one listed above...