2013-09-03 7 views
5

Prawdopodobnie jest to problem z instalacją programu początkującego. Ale tu idzie ...Nie można pobrać projektu z ruby ​​na szyny, aby utworzyć bazę danych

Konfig.urzadz

Mam Windows 7 64 bit maszynę prowadnicach 4.0.0 i Ruby 2.0.0 Mam następujący w mojej ścieżce

C:\Ruby200-x64\bin;C:\RubyDevKit\bin;C:\RubyDevKit\mingw\bin; 

Konfiguracja projektu

Pracuję z sklonowanego projektu git z działającego repozytorium współpracownika.

Kiedy uruchomić mój początkowy

rake db:migrate 

otrzymuję następujący błąd

rake aborted! 
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's 
qlite3'` to your Gemfile. 
C:/Working/mynewproject/config/environment.rb:5:in `<top (required)>' 
Tasks: TOP => db:migrate => environment 
(See full trace by running task with --trace) 

My Gemfile nie zawiera gem 'sqlite3' następująco

# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 

Kompletny Gemfile jest

source 'https://rubygems.org' 

ruby '2.0.0' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.0.0' 
gem 'rails_12factor', group: :production 

# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 

# Use SCSS for stylesheets 
gem 'sass-rails', '~> 4.0.0' 

# Use Twitter Bootstrap for styling 
gem 'bootstrap-sass' 

# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 

# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '~> 4.0.0' 

# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 1.2' 

group :doc do 
    # bundle exec rake doc:rails generates the API under doc/api. 
    gem 'sdoc', require: false 
end 

# Use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano', group: :development 

# Use debugger 
# gem 'debugger', group: [:development, :test] 

gem 'protected_attributes' # should probably use strong parameters! 

Kiedy biegnę bundle install pojawia się następujący wykaz - uwaga brak sqlite3

Using rake (10.1.0) 
Using i18n (0.6.5) 
Using minitest (4.7.5) 
Using multi_json (1.7.9) 
Using atomic (1.1.13) 
Using thread_safe (0.1.2) 
Using tzinfo (0.3.37) 
Using activesupport (4.0.0) 
Using builder (3.1.4) 
Using erubis (2.7.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using actionpack (4.0.0) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (4.0.0) 
Using activemodel (4.0.0) 
Using activerecord-deprecated_finders (1.0.3) 
Using arel (4.0.0) 
Using activerecord (4.0.0) 
Using sass (3.2.10) 
Using bootstrap-sass (2.3.2.2) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.1) 
Using coffee-script (2.2.0) 
Using thor (0.18.1) 
Using railties (4.0.0) 
Using coffee-rails (4.0.0) 
Using hike (1.2.3) 
Using jbuilder (1.5.1) 
Using jquery-rails (3.0.4) 
Using json (1.8.0) 
Using protected_attributes (1.0.3) 
Using bundler (1.3.5) 
Using tilt (1.4.1) 
Using sprockets (2.10.0) 
Using sprockets-rails (2.0.0) 
Using rails (4.0.0) 
Using rails_serve_static_assets (0.0.1) 
Using rails_stdout_logging (0.0.2) 
Using rails_12factor (0.0.2) 
Using rdoc (3.12.2) 
Using sass-rails (4.0.0) 
Using sdoc (0.3.20) 
Using turbolinks (1.3.0) 
Using uglifier (2.2.1) 
Your bundle is complete! 

Kiedy zrobić bundle show 'sqlite3' uzyskać

Could not find gem 'sqlite3'. 
Did you mean sqlite3? 

Kiedy zrobić gem install 'sqlite3' uzyskać

Successfully installed sqlite3-1.3.8-x64-mingw32 
Parsing documentation for sqlite3-1.3.8-x64-mingw32 
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/2.0/sqlite3_native.so, skipping 
1 gem installed 

Po wyszukiwaniu informacji o tym błędzie "Nie można przekonwertować", odkryłem, że mogę zainstalować bez dokumentacji. Tak więc, jeśli robię

gem install 'sqlite3' --no-doc 

uzyskać

Successfully installed sqlite3-1.3.8-x64-mingw32 
1 gem installed 

i wtedy kiedy ja

rake db:migrate 

wciąż otrzymuję

rake aborted! 
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's 
qlite3'` to your Gemfile. 
C:/Working/mynewproject/config/environment.rb:5:in `<top (required)>' 
Tasks: TOP => db:migrate => environment 
(See full trace by running task with --trace) 

więc, co ja brakowało?

Dzięki

Aktualizacja po robienia rzeczy sugerowane w komentarzach:

Wskutek komentarzu Doon „s Włożyłem zawartość gemfile w opisie problemu powyżej

W odpowiedzi na komentarz techvineet uruchomiłem bundle install kilka razy ze spójnymi wyjściami.

Wskutek zrl3dx „komentarzu s Mam teraz biegł bundle exec bundle i uzyskać taki sam efekt, tzn

Using rake (10.1.0) 
Using i18n (0.6.5) 
Using minitest (4.7.5) 
Using multi_json (1.7.9) 
Using atomic (1.1.13) 
Using thread_safe (0.1.2) 
Using tzinfo (0.3.37) 
Using activesupport (4.0.0) 
Using builder (3.1.4) 
Using erubis (2.7.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using actionpack (4.0.0) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (4.0.0) 
Using activemodel (4.0.0) 
Using activerecord-deprecated_finders (1.0.3) 
Using arel (4.0.0) 
Using activerecord (4.0.0) 
Using sass (3.2.10) 
Using bootstrap-sass (2.3.2.2) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.1) 
Using coffee-script (2.2.0) 
Using thor (0.18.1) 
Using railties (4.0.0) 
Using coffee-rails (4.0.0) 
Using hike (1.2.3) 
Using jbuilder (1.5.1) 
Using jquery-rails (3.0.4) 
Using json (1.8.0) 
Using protected_attributes (1.0.3) 
Using bundler (1.3.5) 
Using tilt (1.4.1) 
Using sprockets (2.10.0) 
Using sprockets-rails (2.0.0) 
Using rails (4.0.0) 
Using rails_serve_static_assets (0.0.1) 
Using rails_stdout_logging (0.0.2) 
Using rails_12factor (0.0.2) 
Using rdoc (3.12.2) 
Using sass-rails (4.0.0) 
Using sdoc (0.3.20) 
Using turbolinks (1.3.0) 
Using uglifier (2.2.1) 
Your bundle is complete! 

Wskutek Sachin Singh” komentarzu s Usunąłem Gemfile.lock i biegł bundle install. Wyniki były niemal tak samo:

Fetching gem metadata from https://rubygems.org/.......... 
Fetching gem metadata from https://rubygems.org/.. 
Resolving dependencies... 
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using minitest (4.7.5) 
Using multi_json (1.7.9) 
Using atomic (1.1.13) 
Using thread_safe (0.1.2) 
Using tzinfo (0.3.37) 
Using activesupport (4.0.0) 
Using builder (3.1.4) 
Using erubis (2.7.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using actionpack (4.0.0) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (4.0.0) 
Using activemodel (4.0.0) 
Using activerecord-deprecated_finders (1.0.3) 
Using arel (4.0.0) 
Using activerecord (4.0.0) 
Using sass (3.2.10) 
Using bootstrap-sass (2.3.2.2) 
Using bundler (1.3.5) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.1) 
Using coffee-script (2.2.0) 
Using thor (0.18.1) 
Using railties (4.0.0) 
Using coffee-rails (4.0.0) 
Using hike (1.2.3) 
Using jbuilder (1.5.1) 
Using jquery-rails (3.0.4) 
Using json (1.8.0) 
Using protected_attributes (1.0.3) 
Using tilt (1.4.1) 
Using sprockets (2.10.0) 
Using sprockets-rails (2.0.0) 
Using rails (4.0.0) 
Using rails_serve_static_assets (0.0.1) 
Using rails_stdout_logging (0.0.2) 
Using rails_12factor (0.0.2) 
Using rdoc (3.12.2) 
Using sass-rails (4.0.0) 
Using sdoc (0.3.20) 
Using turbolinks (1.3.0) 
Using uglifier (2.2.1) 
Your bundle is complete! 
Use `bundle show [gemname]` to see where a bundled gem is installed. 

tak nadal nie ma wzmianki o sqlite3 i rake db:migrate nadal skutkuje

rake aborted! 
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's 
qlite3'` to your Gemfile. 
C:/Working/its-a-disaster/config/environment.rb:5:in `<top (required)>' 
Tasks: TOP => db:migrate => environment 
(See full trace by running task with --trace) 

w odpowiedzi na Sachin Singh jest pytanie, co jest wyjście ruby -v command?

Mówi:

ruby 2.0.0p247 (2013-06-27) [x64-mingw32] 

i szyny version mówi

Rails 4.0.0 

Prusswan zadawane są tam inne instalacje Ruby na tym samym komputerze?

Było trzy - 1.9.2, 1.9.3 i 2.0.0 Ten ostatni jest tym na ścieżce. Dwa pozostałe, które usunąłem.

+0

wysłać swój Gemfile, gdzie jest określony gem sqlite3? Czy to jest w grupie deweloperskiej? – Doon

+0

Czy uruchomiłeś ponownie instalację pakietu po określeniu jej w tym miejscu? Po prostu umieść go w swoim pakiecie, jak np. "Sqlite3" i ponownie uruchom instalację pakietu. – techvineet

+0

@Doon - zaktualizowano, aby dodać plik gemfile w pytaniu – Jane

Odpowiedz

8

Znany jest problem z Bundlerem i 64-bitowym Rubim, który nie wykrywa w tym pakiecie platform klejnotowych x64-mingw32, co sprawia, że ​​się nie udaje.

Uważam ten został naprawiony w wersji 1.4.0 przedpremierowych, a można spróbować, wykonując:

gem update bundler --pre 

bundle install 

Są też inne problemy mogą się pojawić w wersji 64Bits. Oto moja osobista rekomendacja:

Jeśli naprawdę nie jesteś zmuszony do pracy lub tworzenia aplikacji, które używa więcej niż 2 GB pamięci RAM (najprawdopodobniej nie jest to aplikacja Rails), polecam używanie 32-bitowej wersji Ruby (i odpowiedni DevKit)

Podczas gdy masz 64-bitową wersję systemu Windows, system jest zdolny do uruchamiania aplikacji 32-bitowych bez problemów. Nie ma obniżenia wydajności, które można zauważyć podczas tworzenia aplikacji internetowych z Railsami.

Podczas gdy Ruby 2.0.0 został oznaczony jako stabilny i gotowy do produkcji, nie wszystkie klejnoty i powiązane narzędzia zostały zaktualizowane, aby działały prawidłowo.Nadal istnieją pewne ostre krawędzie, które należy wyprostować, jak widać na przykładzie Bundlera i 64-bitowego Rubiego. Jak większość oprogramowania open-source, jest to wysiłek społeczności i może być wymagana pomoc.

Mam nadzieję, że to pomoże.

+0

Dzięki Luis. To polecenie zadziałało i uratowało mnie przed ręczną zamianą -x86-mingw32 na -x64-mingw32 – Jane

+0

Z przyjemnością słucham @Jane, ale pamiętaj o innych zaleceniach. Możesz napotkać inne problemy z niektórymi klejnotami, które nie działają tak dobrze, jak robią to w wersji 32-bitowej. –

Powiązane problemy