Closed aeaghannam closed 7 years ago
Commit and push to your repo, and then comment here with a link to your Gemfile
Thanks Juan, it actually looks like I have the devise gem already installed. According to the 'gem list' command I have "devise (4.2.1)" installed yet still have issues this. I also am having issues with pushing my app to GitHub...I'll have to check in during the next open office hours today.
Hi @aeaghannam, did you get help from John yet about this problem?
@AWhitleyGA yup, John helped me out. It looks like I didn't manually add the devise gem in my gem file, my previous 'gem list' command was just displaying that I had the gem somewhere in my computer but not necessarily in the gem file in question. thanks!
ok guys, now it seems like I have another issue with this...
I added gem "devise" to my gem file (see screenshot) and installed '$ bundle install', but when I attempt '$ rails g devise:install' I get the following error:
$ rails g devise:install
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'devise'. Gem Load Error is: undefined method
alias_method_chain' for ActionDispatch::Routing::RouteSet:Class
Did you mean? alias_method
Backtrace for gem load error is:
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/devise-1.5.4/lib/devise/rails/routes.rb:14:in <class:RouteSet>' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/devise-1.5.4/lib/devise/rails/routes.rb:2:in
<top (required)>' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in
require'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in block in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:258:in
load_dependency'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/devise-1.5.4/lib/devise/rails.rb:1:in
<top (required)>'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in
block in require'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:258:in load_dependency' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:292:in
require'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/devise-1.5.4/lib/devise.rb:445:in <top (required)>' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in
require'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in block (2 levels) in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in
each'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in block in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in
each'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in require' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in
require'
/Users/abrahimelias/Code101/config/application.rb:7:in <top (required)>' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:82:in
require'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:82:in preload' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:143:in
serve'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:131:in block in run' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in
loop'
/Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in run' /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in
<top (required)>'
/Users/abrahimelias/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' /Users/abrahimelias/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
require'
-e:1:in <main>' Bundler Error Backtrace: (Bundler::GemRequireError) from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:90:in
block (2 levels) in require'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in each' from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in
block in require'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in each' from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in
require'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in require' from /Users/abrahimelias/Code101/config/application.rb:7:in
<top (required)>'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:82:in require' from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:82:in
preload'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:143:in serve' from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:131:in
block in run'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in loop' from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application.rb:125:in
run'
from /Users/abrahimelias/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in <top (required)>' from /Users/abrahimelias/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
require'
from /Users/abrahimelias/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in
Interesting. Make sure that you see devise listed in the Gemfile.lock
. If you do, please commit and push your current code to GitHub so I can clone it down and test it out.
Also, make sure you saved your Gemfile
and ran bundle install
after saving.
I was able to run bundle install and "Using devise 1.5.4" is listed, but still having issues with the next step...I also can't seem to push this to Githib :/
What error are you getting when you try to push?
$ git push origin master fatal: 'origin' does not appear to be a git reposi tory fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I think @jsm13 may have mentioned some sort of access key issue is present on my Github account last week, not sure if that is causing this issue here
These are the access keys I currently have, not sure if this is an issue...
Maybe, show me what you get back when you run git remote -v
hmm nothing seems to happen ...
So you need to first set up a repository on GitHub with a name matching your local one (Code101), add it as a remote, and then push:
~/Code101
, run git remote add origin <paste-ssh-key>
@AWhitleyGA ok so I was able to do all the steps above Andy, yet I have this issue when I try to push my code up....
I think your ssh keys for github might not be loaded.
In your terminal, run this command:
ssh-add -l -E md5
Output should look something like this:
4096 MD5:f2:f7:1a:4a:14:48:10:19:2b:92:91:b4:1f:9b:d1:23 your_username@email_server.com (RSA)
Your fingerprint (the part after MD5:
) should match with one of the keys on your github settings: https://github.com/settings/keys.
Let me know what output you get and whether or not it matches whats in your settings page.
@juancgarcia this is the message I get when I run the command you specified: $ ssh-add -l -E md5 The agent has no identities.
these are my current key settings ...
Do you think I should delete my Windows Key that I set up for my PC a few weeks ago?
Additional keys aren't a problem. What github needs is a match between the public key you've given them, and the private key you hold.
Since the command had no output, then you need to load your key again.
run ls
on your ssh folder:
ls -la ~/.ssh/
You hopefully only have a few files here. Each key should come in pairs (private has no extension, and the public has the same name with .pub
at the end) like id_rsa
and id_rsa.pub
.
Starting with the newest private key file, run this command and find the key which matches a fingerprint on github:
ssh-keygen -E md5 -lf ~/.ssh/my_key_rsa
(replace my_key_rsa with the filename you're testing)
Once you've found the right key, run the following (again replacing my_key_rsa with your filename)
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/my_key_rsa
That should get your key loaded
ok @juancgarcia , so I followed your steps above until I got to "finding the right key" - the following results don't match any of the keys I have listed on my profile ...
my keys....
Try it with the github_rsa
file.
Hi Juan so that file above worked (in green)...but when I got to the last step you mentioned (in red) my password didn't work. I updated my password and tried that to confirm I was using the correct one, yet still the same issue:
I'll continue working on other elements of my app and check-in to the next office hours tmrw, if that's easier
that passphrase will be different than the machine's default password. If you set that up in class we recommended leaving it blank. If that doesn't work, I'd recommend setting up new keys following the steps here
@aeaghannam If John's suggestion got you up and running, go ahead and close this issue.
Hi all,
I'm having issues with install 'Devise' in my rails app in order to create user authentication log-ins:
When I attempt to follow our last lesson plan on the matter and I attempt to do the following in the terminal (while directed in my app directory):
In order to use Devise, we must include it in our Gemfile... gem "devise" $ bundle install $ rails g devise:install
I end up getting the following error message in the terminal: Running via Spring preloader in process 82152 Could not find generator 'devise:install_'. Maybe you meant 'test_unit:job', 'assets' or 'generator' Run
rails generate --help
for more options.