kurenn / sabisu-rails

Simple and powerful engine for exploring your Rails api application
MIT License
127 stars 29 forks source link

uninitialized constant Sprockets::SassCacheStore #26

Closed hiimtaylorjones closed 9 years ago

hiimtaylorjones commented 9 years ago

Hey there,

Currently, I can't render the index view for Sabisu because of the following error:

screen shot 2015-05-13 at 1 10 29 pm

Any idea what's going on here? Seems like maybe you called a depreciated class from Sprockets? I'm currently running with Rails 4.2.1.

kurenn commented 9 years ago

Try to update compass-rails gem to at least 2.0.2

gem 'compass-rails', '~> 2.0.2'
hiimtaylorjones commented 9 years ago

Cool. That took care of the Sass error. However, there's something else going on.

screen shot 2015-05-14 at 10 43 46 am

kurenn commented 9 years ago

How does your sabisu_rails initializer file looks like?...

hiimtaylorjones commented 9 years ago
SabisuRails.setup do |config|

  # Base uri for posting the
  config.base_api_uri = 'api.marketplace.dev'

  # Ignored attributes for building the forms
  # config.ignored_attributes = %w{ created_at updated_at id }

  # HTTP methods
  # config.http_methods = %w{ GET POST PUT DELETE PATCH }

  # Headers to include on each request
  config.api_headers = { "Accept" => "application/vnd.marketplace.v1" }

  # Layout configuration
  # config.layout = "sabisu"

  # Resources on the api
  config.resources = [:users]

  # Application name
  # mattr_accessor :app_name
  # @@app_name = Rails.application.class.parent_name

  # Authentication
  # mattr_accessor :authentication_username
  # @@authentication_username = "admin"

  # mattr_accessor :authentication_password
  # @@authentication_password = "sekret"

end
kurenn commented 9 years ago

You need to have a default_resource set up, in this case the users, like:

# Default resource
config.default_resource = :users
hiimtaylorjones commented 9 years ago

I've tried that as well. Still no luck :(

kurenn commented 9 years ago

Did you restart the server?

hiimtaylorjones commented 9 years ago

Yeah. The same issue still persists.

kurenn commented 9 years ago

This is the configuration for a sample project https://github.com/kurenn/market_place_api/blob/chapter8/config/initializers/sabisu_rails.rb

Let me know how it goes

hiimtaylorjones commented 9 years ago

Yeah man, I've been using that same configuration going through the API book you wrote. Same errors persist.

kurenn commented 9 years ago

Do you have the repo online?

hiimtaylorjones commented 9 years ago

Yep!

https://github.com/CodedBeardedSignedTaylor/RailsApiDemo

kurenn commented 9 years ago

I manage to make it work:

You just need to fetch the sabisu gem from the github repo:

gem 'sabisu_rails', github: "IcaliaLabs/sabisu-rails"

Run the bundle command to install it and restart the pow server:

% bundle install; touch tmp/restart.txt

If you visit the explorer now, it should work!

hiimtaylorjones commented 9 years ago

Excellent! This fixes everything!

hiimtaylorjones commented 9 years ago

For documentation purposes, is there a need to specify those gem versions for users of Rails 4.2+?

Let me know if there is. I'd be happy to go in there and insert it.

kurenn commented 9 years ago

We can probably publish a wiki page, or on the project README

I would say on the readme, can you place the PR?

hiimtaylorjones commented 9 years ago

Sure thing. I'll probably end up getting to it tomorrow evening.

kurenn commented 9 years ago

Solved with https://github.com/IcaliaLabs/sabisu-rails/pull/27