Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Require gems in bin/hanami file" #620

Merged
merged 1 commit into from
Jul 22, 2016

Conversation

jodosha
Copy link
Member

@jodosha jodosha commented Jul 22, 2016

This reverts commit 9a8db04.

We use hanami bin both inside and outside Hanami projects. Inside, with the presence of a Gemfile, requiring hanami/setup just works fine. But outside, without a Gemfile, hanami crashes.

 ➜ hanami version
/Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:170:in `rescue in root': Could not locate Gemfile or .bundle/ directory (Bundler::GemfileNotFound)
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:166:in `root'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:74:in `bundle_path'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:414:in `configure_gem_home_and_path'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:60:in `configure'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:121:in `definition'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:91:in `setup'
    from /Users/luca/.gem/ruby/2.3.1/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
    from /Users/luca/.gem/ruby/2.3.1/gems/hanami-0.8.0/lib/hanami/setup.rb:3:in `<top (required)>'
    from /Users/luca/.rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/luca/.rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/luca/.gem/ruby/2.3.1/gems/hanami-0.8.0/bin/hanami:4:in `<top (required)>'
    from /Users/luca/.gem/ruby/2.3.1/bin/hanami:22:in `load'
    from /Users/luca/.gem/ruby/2.3.1/bin/hanami:22:in `<main>'

This problem affects hanami version and hanami new, which are the only two commands that are run outside of a Hanami project.


Ref #566
FYI @davydovanton

@jodosha jodosha added this to the v0.8.0 milestone Jul 22, 2016
@jodosha jodosha self-assigned this Jul 22, 2016
@jodosha jodosha added the fix label Jul 22, 2016
@davydovanton
Copy link
Member

it's really strange 😰
any way, thanks for mention me, @jodosha 👍

@coveralls
Copy link

coveralls commented Jul 22, 2016

Coverage Status

Coverage increased (+0.003%) to 92.593% when pulling 6eec646 on fix/remove-require-gems-from-hanami-bin into 9ad448d on master.

@jodosha
Copy link
Member Author

jodosha commented Jul 22, 2016

@davydovanton To try it you should install all the gems locally. This simulates end users installing our gems from Rubygems.

I created this quick and dirty script for the job: https://github.com/jodosha/dotfiles/blob/master/bin/install-hanami-head

Then you should try to do hanami version.

@jodosha jodosha merged commit 2ebff3f into master Jul 22, 2016
@jodosha jodosha deleted the fix/remove-require-gems-from-hanami-bin branch July 22, 2016 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants