当我运行rake assets:precompile RAILS_ENV=production
我收到以下错误:
/usr/local/rvm/gems/ruby-1.9.3-p327@eapi4/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find i18n-0.6.4 in any of the sources (Bundler::GemNotFound)
然而,所有的宝石都已安装:
Using rake (10.1.0)
Using i18n (0.6.4)
Using minitest (4.7.5)
Using multi_json (1.7.8)
Using atomic (1.1.12)
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.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
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 addressable (2.3.2)
Using annotate (2.5.0)
Using bcrypt-ruby (3.1.1)
Using sass (3.2.10)
Using bootstrap-sass (2.3.2.1)
Using highline (1.6.19)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using net-sftp (2.1.2)
Using net-ssh-gateway (1.2.0)
Using capistrano (2.15.5)
Using capistrano-ext (1.2.1)
Using mini_portile (0.5.1)
Using nokogiri (1.6.0)
Using ffi (1.1.5)
Using childprocess (0.3.5)
Using libwebsocket (0.1.5)
Using rubyzip (0.9.9)
Using selenium-webdriver (2.25.0)
Using xpath (0.1.4)
Using capybara (1.1.2)
Using orm_adapter (0.4.0)
Using ckeditor (4.0.6)
Using client_side_validations (3.2.2) from git://github.com/bcardarella/client_side_validations.git (at 4-0-beta)
Using simple_form (3.0.0.rc)
Using client_side_validations-simple_form (2.1.0) from git://github.com/saveritemedical/client_side_validations-simple_form.git (at master)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using commonjs (0.2.6)
Using delayed_job (4.0.0)
Using delayed_job_active_record (4.0.0)
Using warden (1.2.3)
Using devise (3.0.2)
Using diff-lcs (1.1.3)
Using launchy (2.3.0)
Using email_spec (1.5.0)
Using factory_girl (4.2.0)
Using factory_girl_rails (4.2.1)
Using faker (1.2.0)
Using font-awesome-rails (3.2.1.2)
Using tilt (1.4.1)
Using haml (4.0.3)
Using haml-rails (0.4)
Using hike (1.2.3)
Using jbuilder (1.5.0)
Using jquery-rails (3.0.4)
Using jquery-ui-rails (4.0.4)
Using json (1.8.0)
Using kaminari (0.14.1)
Using kgio (2.8.1)
Using less (2.3.2)
Using less-rails (2.3.3)
Using libv8 (3.11.8.17)
Using metaclass (0.0.1)
Using mocha (0.14.0)
Using negative_captcha (0.3.3)
Using nested_form (0.3.2)
Using nifty-generators (0.4.6)
Using pg (0.16.0)
Using rack-pjax (0.7.0)
Using bundler (1.3.5)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using remotipart (1.2.1)
Using safe_yaml (0.9.4)
Using sass-rails (4.0.0)
Using rails_admin (0.5.0) from git://github.com/sferik/rails_admin.git (at master)
Using raindrops (0.12.0)
Using rdoc (3.12.2)
Using ref (1.0.5)
Using rest-client (1.6.7)
Using rspec-core (2.12.2)
Using rspec-expectations (2.12.1)
Using rspec-mocks (2.12.2)
Using rspec-rails (2.12.2)
Using rvm-capistrano (1.5.0)
Using sdoc (0.3.20)
Using sequel (3.20.0)
Using shoulda-context (1.1.5)
Using shoulda-matchers (2.3.0)
Using shoulda (3.5.0)
Using sinatra (1.0)
Using spring (1.3.4)
Using sqlite3 (1.3.8)
Using taps (0.3.24)
Using therubyracer (0.11.4)
Using turbolinks (1.3.0)
Using twitter-bootstrap-rails (2.2.7)
Using uglifier (2.1.2)
Using unicorn (4.6.3)
如何解决此错误?
答案 0 :(得分:0)
它与gemsets有关。
在命令前加bundle exec
使其在您的包的上下文中运行,使用Gemfile中指定的gem(应用程序的gems版本可能与您的系统上安装的gems版本不同)。
所以解决方案是按如下方式运行它:
bundle exec rake assets:precompile RAILS_ENV=production