Coder Social home page Coder Social logo

Comments (19)

alloy avatar alloy commented on June 20, 2024

Can you try it without RVM and gemsets? There shouldn’t be a need for this, especially as you’re not doing any other Ruby dev, right?

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

This doesn't change anything.

$ rvm current
system
$ rake bootstrap
/usr/bin/bundler

--------------------------------------------------------------------------------
Fetching repositories list
--------------------------------------------------------------------------------
rake aborted!
NoMethodError: undefined method `metas' for #<Tempfile:0x007faee8884b10>
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:417:in `block in fetch_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:412:in `loop'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:412:in `fetch_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:398:in `fetch_default_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:48:in `block in <top (required)>'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:35:in `block in <top (required)>'
Tasks: TOP => clone
(See full trace by running task with --trace)

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

FYI:

$ gem list

*** LOCAL GEMS ***

activesupport (3.2.17, 3.2.16)
addressable (2.3.6)
ast (1.1.0)
bacon (1.2.0)
bigdecimal (1.2.0)
bundler (1.6.2)
CFPropertyList (2.2.6, 2.2.0)
claide (0.5.0, 0.4.0)
cocoapods (0.32.1, 0.29.0)
cocoapods-core (0.32.1, 0.29.0)
cocoapods-downloader (0.5.0, 0.3.0)
cocoapods-plugins (0.1.1, 0.1.0)
cocoapods-try (0.2.0)
cocoapods-try-release-fix (0.1.2, 0.1.1)
colored (1.2)
coveralls (0.7.0)
crack (0.4.2)
docile (1.1.3)
escape (0.0.4)
fuzzy_match (2.0.4)
i18n (0.6.9)
io-console (0.4.2)
json (1.8.1, 1.7.7)
json_pure (1.8.1)
libxml-ruby (2.7.0, 2.6.0)
metaclass (0.0.4)
mime-types (2.2)
mini_portile (0.5.2)
minitest (4.3.2)
mocha (1.0.0)
mocha-on-bacon (0.2.2)
multi_json (1.9.2, 1.8.2)
nap (0.7.0, 0.6.0)
nokogiri (1.6.1, 1.5.6)
open4 (1.3.3, 1.3.0)
parser (2.1.7)
powerpack (0.0.9)
prettybacon (0.0.1)
psych (2.0.0)
rainbow (2.0.0)
rake (10.2.2, 10.1.1, 0.9.6)
rdoc (4.0.0)
rest-client (1.6.7)
rubocop (0.20.1, 0.20.0)
ruby-progressbar (1.4.2)
rubygems-update (2.2.2)
safe_yaml (1.0.2)
simplecov (0.8.2)
simplecov-html (0.8.0)
slop (3.5.0)
sqlite3 (1.3.8, 1.3.7)
term-ansicolor (1.3.0)
test-unit (2.0.0.0)
thor (0.19.1)
tins (1.1.0)
webmock (1.17.4)
xcodeproj (0.16.1, 0.14.1)

from rainforest.

alloy avatar alloy commented on June 20, 2024

Looking at the API for OpenURI, it seems the method is misspelled. It should probably be just meta: http://apidock.com/ruby/OpenURI/Meta (the header fields).

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Progress.

$ sed -n 417p Rakefile 
    link = file.meta['link'].first
$ rake bootstrap
/usr/bin/bundler

--------------------------------------------------------------------------------
Fetching repositories list
--------------------------------------------------------------------------------
rake aborted!
NoMethodError: undefined method `first' for #<String:0x007fdf018977f8>
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:417:in `block in fetch_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:412:in `loop'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:412:in `fetch_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:398:in `fetch_default_repos'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:48:in `block in <top (required)>'
/Users/olivier/Documents/Dev/GitHub/Rainforest/Rakefile:35:in `block in <top (required)>'
Tasks: TOP => clone
(See full trace by running task with --trace)

from rainforest.

alloy avatar alloy commented on June 20, 2024

Hrmm, I have the feeling that the objects returned by OpenURI might have different APIs on different Ruby versions. @irrationalfab can you confirm?

In this case, assuming that @irrationalfab confirms that on other Ruby versions this does return an Array, it would have to be made compatible with all. I think this should help:

link = Array(file.meta['link']).first

The Kernel::Array() method wraps an object in an array, unless it’s already an Array.

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

This seems to work, the rake script is cloning repos right now!

$ sed -n 417p Rakefile 
    link = Array(file.meta['link']).first
$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

from rainforest.

alloy avatar alloy commented on June 20, 2024

Ok, let’s see what @irrationalfab says about why the code is as it is right now and then patch it accordingly.

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024
$ ri OpenURI::Meta#meta
 = OpenURI::Meta#meta

(from ruby core)
------------------------------------------------------------------------------

returns a Hash that represents header fields. The Hash keys are downcased for
canonicalization.

I believe that if there is only one header of a given header key (like link), it returns an String, and only returns an array if there are multiple values for the same header. But I'll wait for @irrationalfab validation before pushing the fix.

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Something strange about this Rakefile anyway:

  • The first time I tried to rake bootstrap, it stopped asking me to manually install bundler

  • So I did some sudo gem install bundler (even if I found it strange as I believe the gem was already installed) and ran rake bootstrap again

  • But then after cloning all the repositories, it failed on this:

    gem install bundler
    ERROR:  While executing gem ... (Gem::FilePermissionError)
    
  • So I sudo rake bootstrap to workaround the permission error, which did the trick but showed me this warning:

    gem install bundler
    Successfully installed bundler-1.6.2
    Parsing documentation for bundler-1.6.2
    1 gem installed
    bundle install
    Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
    installing your bundle as root will break this application for all non-root
    users on this machine.
    

Seems strange that even if I manually installed bundler explicitly before running rake, it tried to install it again, right?

from rainforest.

alloy avatar alloy commented on June 20, 2024

One of the repos Rakefile’s is probably trying to install Bundler as part of rake bootstrap which should not be done. It has to be installed manually before running rake bootstrap. Can you figure out which repo it is?

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Will try, but am a bit lost with all this code in multiple Rakefiles and all the repos 😉

If it helps, this was in the "Installing gems" section of the output:

[...]
Cloning cocoapods-plugins
Already cloned

Cloning shared
Already cloned

--------------------------------------------------------------------------------
Bootstrapping all the repositories
--------------------------------------------------------------------------------

Bootstrapping CLAide/
rake --no-search bootstrap

--------------------------------------------------------------------------------
Installing gems
--------------------------------------------------------------------------------

gem install bundler
[...]

from rainforest.

alloy avatar alloy commented on June 20, 2024

There we go, it’s in the CLAide Rakefile: https://github.com/CocoaPods/CLAide/blob/master/Rakefile#L8.

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

CLAide is the one: https://github.com/CocoaPods/CLAide/blob/master/Rakefile#L8

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Damn you shot first 😆

from rainforest.

alloy avatar alloy commented on June 20, 2024

👯

So yeah, it probably use a check like this repo’s Rakefile has and print an error to install bundler. In any case, it should not try to install bundler.

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Just FYI, once I manually fixed both:

  • line 417 of Rainforest's Rakefile
  • the bootstrap task of CLAide's Rakefile to remove the sh gem install bundle line (but keep sh bundle install line)

I was finally able to complete the installation, confirmed by running CocoaPods/bin/pod --help

This still needs some official fix though

from rainforest.

AliSoftware avatar AliSoftware commented on June 20, 2024

Fixed by 4a8fac0

from rainforest.

fabiopelosin avatar fabiopelosin commented on June 20, 2024

👍

from rainforest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.