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

Standalone installation instructions don't appear to work #2

Open
unikitty37 opened this issue Feb 16, 2019 · 7 comments
Open

Standalone installation instructions don't appear to work #2

unikitty37 opened this issue Feb 16, 2019 · 7 comments

Comments

@unikitty37
Copy link

I have managed to get the generator installed when going through the Gemfile/bundler route, but I don't want to make it a dependency of my project.

When I follow the instructions for installing a global copy, I get the following results:

$ gem install matas_service_generator
Successfully installed matas_service_generator-0.1.1
1 gem installed

$ rails g service -h
Could not find generator 'service'. Maybe you meant 'devise', 'resource' or 'helper'
Run `rails generate --help` for more options.

Is there something else I need to do? (I'm running rbenv, so I tried rbenv rehash without it making any difference…)

Thanks!

@zenjara
Copy link
Owner

zenjara commented Feb 18, 2019

Hey, I believe it's due to mismatch versions of ruby.
Please check this: https://stackoverflow.com/questions/2797020/ruby-gem-not-found-although-it-is-installed
and try with a different version.

@unikitty37
Copy link
Author

Sorry, that page doesn't seem to help much. rbenv has both gem and rails pointing at the same version:

$ which gem
/Users/user/.rbenv/shims/gem

$ which rails
/Users/user/.rbenv/shims/rails

$ rbenv local
2.4.5

$ gem which matas_service_generator
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator.rb

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.2
  - RUBY VERSION: 2.4.5 (2018-10-18 patchlevel 335) [x86_64-darwin18]
  - INSTALLATION DIRECTORY: /Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0
  - USER INSTALLATION DIRECTORY: /Users/user/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: /Users/user/.rbenv/versions/2.4.5/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /Users/user/.rbenv/versions/2.4.5/bin
  - SPEC CACHE DIRECTORY: /Users/user/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/user/.rbenv/versions/2.4.5/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-18
  - GEM PATHS:
     - /Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0
     - /Users/user/.gem/ruby/2.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/user/.rbenv/versions/2.4.5/bin
     - /Users/user/.rbenv/libexec
     - /Users/user/.rbenv/plugins/ruby-build/bin
     - /Users/user/.rbenv/shims
     - /Users/user/.rbenv/bin
     - /Users/user/.rbenv/shims
     - /usr/local/opt/rbenv/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Users/user/.rbenv/bin
     - /Users/user/bin
     - /usr/local/git/bin
     - /opt/local/bin
     - /opt/local/sbin
     - /Users/user/go/bin
     - /usr/local/sbin
     - /usr/local/opt/gnu-sed/libexec/gnubin
     - /usr/local/opt/sqlite/bin
     - /usr/local/mysql/bin
     - /usr/local/opt/go/libexec/bin

I tried installing with bundle exec gem install matas_service_generator but this didn't change anything.

@zenjara
Copy link
Owner

zenjara commented Feb 18, 2019

Hey, could you try:
gem install --user-install matas_service_generator
and
gem install matas_service_generator -V
and show me what the responses are?

@unikitty37
Copy link
Author

$ gem install --user-install matas_service_generator
WARNING:  You don't have /Users/user/.gem/ruby/2.4.0/bin in your PATH,
	  gem executables will not run.
Successfully installed matas_service_generator-0.1.1
1 gem installed

$ gem install matas_service_generator -V
HEAD https://rubygems.org/api/v1/dependencies
200 OK
GET https://rubygems.org/api/v1/dependencies?gems=matas_service_generator
200 OK
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/.gitignore
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/CODE_OF_CONDUCT.md
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/Gemfile
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/LICENSE.txt
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/README.md
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/Rakefile
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/bin/console
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/bin/setup
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.03.13.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.03.29.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.05.45.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.07.22.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.07.32.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.07.43.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/docs/images/Screen Shot 2018-11-20 at 14.09.40.png
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator.rb
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator/railtie.rb
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator/service/USAGE
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator/service/service_generator.rb
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator/service/templates/service.erb
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/lib/matas_service_generator/version.rb
/Users/user/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/matas_service_generator-0.1.1/matas_service_generator.gemspec
Successfully installed matas_service_generator-0.1.1
1 gem installed

Thanks!

@ivanmatas
Copy link
Contributor

Maybe try to add that location to the PATH?
Or try something like this: rbenv/rbenv#795

@unikitty37
Copy link
Author

Not sure that issue has the solution — this is all that's in ~/.gemrc:

gem: --no-document

I think the PATH reference is a red herring, as the generator doesn't install a binary, does it? In any case, there is no bin folder in ~/.gem/ruby/2.4.0 (and isn't rbenv supposed to remove the need for --user-install?)

I've completely uninstalled rbenv, removed the ~/.rbenv folder, and reinstalled. Still no joy, though :(

@zenjara
Copy link
Owner

zenjara commented Feb 21, 2019

Hmm, I'm really not sure at this moment how to help you. I will keep investigating, and let you know if I find a way.
Thanks for reporting this! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants