2015-07-15 34 views
7

Ok, więc mam błąd podczas budowania mojego obrazu w Dockerze (pomyśl o tym, że jest podobny do kroku wdrożenia, lub jeśli Herok wdrożysz, jeśli nie znasz Dockera).Zasoby rake'u Prekompiluj bez klejnotów w grupach programistycznych lub testowych

Gems, które są w :test i :development grup są szukali gdy krok prekompilacji dzieje, a odkąd pakiecie --without development test - bo nie chcą mieć QT tak że capybara-webkit nie błąd na wiązce - krok prekompilacji polega na wyrzuceniu błędu.

Błąd jest zawsze wariant:

Could not find <gem-name> in any of the sources (Bundler::GemNotFound) 

My Gemfile:

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.1.9' 
# Use sqlite3 as the database for Active Record 
# gem 'sqlite3' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.1.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', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0', group: :doc 

# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Unicorn as the app server 
# gem 'unicorn' 
gem 'unicorn', '~> 4.8.3' 
gem 'unicorn-worker-killer', '~> 0.4.2' 

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

gem 'rdf', '~> 1.1.0' 
gem 'tripod', '~> 0.11.1' 

gem 'devise' 
gem 'devise_invitable' 
gem 'authority' 
gem 'mongoid', '~> 4.0.0' 

gem 'bootstrap-sass', '~> 3.3.3' 

# pagination 
gem 'kaminari', '~> 0.16.3' 
gem 'bootstrap-kaminari-views' 

# background processing 
gem 'sidekiq' 
gem 'sidekiq-status' 
gem 'request_store', '~> 1.1.0' 

# add memoization 
gem 'memoist', '~> 0.12.0' 

# dropbox gem for uploads etc 
gem 'dropbox-sdk', '~> 1.6.4' 

# error reporting 
gem 'sentry-raven' 

group :development, :test do 
    gem "rspec-rails", "~> 3.0.0" 
    gem "factory_girl_rails", "~> 4.5.0" 
    gem "capybara", "~> 2.4" 
    gem "database_cleaner" 
    # gem "selenium-webdriver" 
    gem 'poltergeist' 
    gem 'capybara-webkit' 

    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    #gem 'byebug' 
    gem 'pry-byebug' 
    gem 'better_errors', '~> 2.1.1' 

    # Access an IRB console on exception pages or by using <%= console %> in views 
    gem 'web-console', '~> 2.0' 

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    # gem 'spring' 
end 

Linia w Dockerfile gdzie błąd się dzieje:

RUN /bin/bash -l -c "RAILS_ENV=production bundle exec rake assets:precompile RAILS_GROUPS=assets --trace" 

Więc w zasadzie, to, czego tak naprawdę oczekuję, to odpowiednik --without test development dla zadania rake. Czy mogę to zrobić? Jak za kilka rad, już zmienione (w application.rb):

Bundler.require(*Rails.groups) 

do

Bundler.require(:default, :assets, Rails.env) 

ktoś ma Szyny-fu na tyle, aby rozwiązać ten jeden? Sprawdziłem w dokumentach i na SO, a także prosząc moich kolegów, ale wciąż walę głową o ścianę.

+0

Czy kiedykolwiek zdałeś sobie z tego sprawę, ponieważ dostaję ten klejnot, którego nie znaleziono w żadnym źródle błędu, także o zależności (kroplach deszczu) klejnotu (jednorożca), który * jest * instalowany podczas procesu budowania dockera –

+0

Dokładnie jakie klejnoty nie są znalezione? Najprawdopodobniej dzieje się tak, że jeden z klejnotów w grupie ': development,: test' pobiera zależność, która jest również używana przez potok zasobów. Musisz wyizolować tę zależność i umieścić ją w swoim Gemfile poza grupą ': development,: test'. – Chris

Odpowiedz

1
bundle install --path vendor/cache 

Spróbuj tego i daj mi znać, jeśli to nie zadziała!

+0

Dzięki, ale skończyłem zrywając 'capybara-webkit', aby rozwiązać go w końcu. Mam nadzieję, że pomoże to komuś innemu! –