Instalacja gemu Devise

  • Rejestracja: dni
  • Ostatnio: dni
0

Zacząłem ostatnio naukę railsów z książki:
https://helion.pl/ksiazki/ruby-on-rails-tworzenie-aplikacji-www-john-elder,rrtwww.htm
W jednym z rozdziałów wykorzystywany jest gem Devise(https://rubygems.org/gems/devise)
W pliku Gemfile mam:

Kopiuj
gem 'devise', '~> 4.4', '>= 4.4.1'

Do instalacji gemów wykorzystuję polecenie bundle install. Gdy użyję tego polecenia w terminalu pojawia się prośba o jakieś hasło tylko nie wiem do czego a w książce nie ma nic o tym. Logi:

Kopiuj
user@user:~/kpir$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using rake 12.0.0
Using i18n 0.7.0
Using minitest 5.10.3
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using nokogiri 1.8.0
Using rack 1.6.4
Using mime-types-data 3.2015.1120
Using arel 6.0.3
Using bundler 1.15.1
Using thor 0.19.4
Using concurrent-ruby 1.0.5
Using sqlite3 1.3.13
Using sass 3.4.23
Using tilt 2.0.1
Using execjs 2.6.0
Using json 1.8.3
Using coffee-script-source 1.10.0
Using multi_json 1.12.1
Using rdoc 4.2.1
Fetching bcrypt 3.1.11


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password:

O co chodzi i jak zainstalować ten gem?

  • Rejestracja: dni
  • Ostatnio: dni
0

Masz tam napisane przeciez. Uzytkownik na ktorym obecnie przebywasz w konsoli nie ma uprawnien, podaj haslo tego uzytkownika

  • Rejestracja: dni
  • Ostatnio: dni
0

A jaki użytkownik powinien posiadać uprawnienia? Hasło do konta nie pasuje a gdy się zaloguję jako root i próbuję wykonać polecenie bundle install to pojawiają się komunikaty o błędach:

Kopiuj
user@user:~/Desktop/Ruby/business$ sudo su root
[sudo] password for user: 
root@user:/home/user/Desktop/Ruby/business# 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.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 12.0.0
Using i18n 0.7.0
Using minitest 5.10.3
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using nokogiri 1.8.0
Using rack 1.6.4
Using mime-types-data 3.2015.1120
Using arel 6.0.3
Using bundler 1.15.1
Using thor 0.19.4
Using concurrent-ruby 1.0.5
Using sqlite3 1.3.13
Using sass 3.4.23
Using tilt 2.0.1
Using execjs 2.6.0
Using json 1.8.3
Using coffee-script-source 1.10.0
Using multi_json 1.12.1
Using rdoc 4.2.1
Fetching bcrypt 3.1.11
Installing bcrypt 3.1.11 with native extensions
Using orm_adapter 0.5.0
Using columnize 0.9.0
Using debug_inspector 0.0.2
Using spring 1.3.6
Using tzinfo 1.2.2
Using loofah 2.0.3
Using rack-test 0.6.3
Using warden 1.2.7
Using mime-types 3.1
Using sprockets 3.7.0
Using uglifier 2.7.2
Using coffee-script 2.4.1
Using sdoc 0.4.1
The latest bundler is 1.16.1, but you are currently running 1.15.1.
To update, run `gem install bundler`
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/bcrypt-3.1.11/ext/mri
/usr/bin/ruby2.3 -r ./siteconf20180129-5965-efq7js.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/bcrypt-3.1.11 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/bcrypt-3.1.11/gem_make.out

An error occurred while installing bcrypt (3.1.11), and Bundler cannot
continue.
Make sure that `gem install bcrypt -v '3.1.11'` succeeds before bundling.

In Gemfile:
  devise was resolved to 4.4.1, which depends on
    bcrypt
root@user:/home/user/Desktop/Ruby/business# 

Podpowiedzi Rubiego o użyciu gem install bcrypt -v '3.1.11' nie dają nic, ten sam błąd. Problem jest w tym, że wszędzie gdzie patrzę(kursy, tutoriale, dokumentacja gemu devise) - nigdzie nie ma nawet wzmianki o instalowaniu dodakowych gemów przed samym gemem devise. Więc wie ktoś może o co chodzi i jak poprawnie zainstalować ten gem(devise)? Wszędzie wzystkim ładnie się instaluje, dodam, że inne gemy instaują się bez problemów jak na przykład paperclip czy bootstrap.

Zarejestruj się i dołącz do największej społeczności programistów w Polsce.

Otrzymaj wsparcie, dziel się wiedzą i rozwijaj swoje umiejętności z najlepszymi.