Comments (10)
Sigh. This happens because the RuboCop constant is used when reading the Rakefile, so this line should probably also rescue missing constants:
rescue LoadError, NameError => e
from rainforest.
https://www.youtube.com/watch?v=-rPEguSf35c
from rainforest.
It’s interesting that this require statement does not make the RuboCop
constant available.
from rainforest.
It does, I think...
from rainforest.
The issue is that the Rubocop
constant was renamed to RuboCop
, in a past version of the gem.
Rainforest doesn't have a Gemfile and this leads to Ruby using the gems that it has installed instead of the ones of the bundle of each single repo.
A solution could be to use bundle exec
in the https://github.com/CocoaPods/Rainforest/blob/master/Rakefile#L89 line:
Dir.chdir(dir) do
subtitle "Bootstrapping #{dir}"
if has_rake_task?('bootstrap')
sh "bundle exec rake --no-search bootstrap"
end
end
However this solution, at least as proposed, is not working:
/Users/fabio/.rbenv/versions/2.1.2/bin/rake:23:in `load': cannot load such file -- /Users/fabio/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/specifications/default/bin/rake (LoadError)
from /Users/fabio/.rbenv/versions/2.1.2/bin/rake:23:in `<main>'
rake aborted!
from rainforest.
We should’t use bundle exec
for bootstrapping in the first place, that’s what the whole bootstrap vs other gems+rescue is about: so that you can run the bootstrap task, even if the bundle hasn’t been installed.
from rainforest.
Btw, this has been fixed on the Xcodeproj rep, not sure why it’s still open here.
from rainforest.
Good call, I remember that I explored a couple of approaches but I wasn't satisfied with any.
Anyway the issue might not be completely solved. Other exceptions than name errors which might arise from the versions of the gems of the bundle not being the same as the ones of the ruby installation are not catched. However I propose to keep this closed for lack of better solution (also our coverage in the real world should be pretty high with this one).
from rainforest.
The only proper solution is to not rely on RuboCop to define the rake task, but just define a rake task ourselves and lazily load RuboCop from there once needed.
The RuboCop task is most probably an over-engineered feature anyways, I rarely come across tasks that couldn’t simply be defined manually.
from rainforest.
👍
from rainforest.
Related Issues (20)
- Update homebrew version for CocoaPods
- rake bootstrap fails with Ruby 2.2 due to json gem HOT 4
- cant bootstrap HOT 4
- rake bootstrap fails due to cocoapods-docs Ruby version requirement HOT 5
- Please document the ruby/rake/etc configuration necessary run rake bootstrap
- `rake bootstrap` fails with ruby version error HOT 2
- Rake bootstrap failure help HOT 7
- Warnings using unshallow_all HOT 1
- Bootstrap fails even though bundler 1.17 installed HOT 2
- Failure in Bootstrapping Xcodeproj
- Co
- Rainforest
- Failure bootstrapping setup HOT 1
- rake bootstrap fails with different errors HOT 4
- ( ˶ ̇ ̵ ̇˶ )
- Confised
- Hi
- The
- Bb
- Trees
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainforest.