Skip to content
This repository

Fix error no such file to load — json/add/rails #43

Merged
merged 2 commits into from over 2 years ago

2 participants

Simone Carletti Alexander Lang
Simone Carletti

See http://stackoverflow.com/questions/7442788/couch-potato-no-such-file-to-load-json-add-rails/7444162#7444162

There are two solutions to this issue:

  1. bump JSON requirement in .gemspec to ~> 1.6.0 and remove the require statement
  2. silent the require statement in case of error

I chose the latter because forcing the use of ~> 1.6.0 might break gem compatibility with very old versions of ActiveSupport and make this library not usable with Rails < 3.0. Of course, this is just a guess.

If you bump the release number to 0.6.0 you might want to ignore compatibility with old ActiveSupport versions and jump to JSON 1.6.0 (+1 for this solution).

Alexander Lang
Owner

couch potato >= 0.3 require ActiveSupport >= 3.0 anyway, so bumping the version requirement would be no issue. let's do that.

Simone Carletti

I incorporated the changes to the JSON requirement. I wasn't able to run the entire test suite, there was an error referencing the couch_potato_js_runner.js file.

Alexander Lang langalex merged commit 375a273 into from September 16, 2011
Alexander Lang langalex closed this September 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
8  couch_potato.gemspec
@@ -11,16 +11,16 @@ Gem::Specification.new do |s|
11 11
   s.authors = ["Alexander Lang"]
12 12
   s.version     = CouchPotato::VERSION
13 13
   s.platform    = Gem::Platform::RUBY
14  
-  
15  
-  s.add_dependency 'json'
  14
+
  15
+  s.add_dependency 'json', '~> 1.6.0'
16 16
   s.add_dependency 'couchrest', '>=1.0.1'
17 17
   s.add_dependency 'activemodel'
18  
-  
  18
+
19 19
   s.add_development_dependency 'rspec', '>=2.0'
20 20
   s.add_development_dependency 'timecop'
21 21
   s.add_development_dependency 'tzinfo'
22 22
   s.add_development_dependency 'rake'
23  
-  
  23
+
24 24
   s.files         = `git ls-files`.split("\n")
25 25
   s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
26 26
   s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
5  lib/couch_potato.rb
... ...
@@ -1,7 +1,6 @@
1 1
 require 'couchrest'
2 2
 require 'json'
3 3
 require 'json/add/core'
4  
-require 'json/add/rails'
5 4
 
6 5
 require 'ostruct'
7 6
 
@@ -11,9 +10,9 @@ module CouchPotato
11 10
   Config = Struct.new(:database_name, :validation_framework, :split_design_documents_per_view).new
12 11
   Config.validation_framework = :active_model
13 12
   Config.split_design_documents_per_view = false
14  
-  
  13
+
15 14
   class NotFound < StandardError; end
16  
-  
  15
+
17 16
   # returns all the classes that implement the CouchPotato::Persistence module
18 17
   def self.models
19 18
     @models ||= []
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.