我在Ubuntu 10.04上,我必须推送到Heroku的应用程序有一个Gemfile.lock,这个应用程序是由另一个程序员开发的.
当我使用bundle install命令时,这将安装必要的gem用于使用rails s运行应用程序.
bundle install是否在我的Gemfile或Gemfile.lock中使用特定的gem?
我的Gemfile和Gemfile.lock不一样.
我必须删除Gemfile.lock吗?
这是我的Gemfile:
source 'http://rubygems.org' #ruby '1.9.3' gem 'rails',"= 3.1.11" #gem "rake","= 0.8.7" gem 'racc' # gem 'sqlite3' #gem 'acts_as_list','>= 0.1.0' #gem 'acts_as_tree' gem 'paperclip' gem 'aws-s3',:require => 'aws/s3' gem 'aws-sdk' gem 'gravatar_image_tag' gem 'kaminari' gem 'jquery-rails','~> 2.1' gem 'RedCloth','>= 3.301' gem 'carmen',:git => 'git://github.com/alvatarc/carmen.git',:branch => '0.2.x' #gem 'carmen' gem 'sass-rails' gem 'http_accept_language' gem 'right_aws' gem 'exception_notification' group :development do gem 'sqlite3-ruby',:require => 'sqlite3' gem 'rspec-rails','= 2.7.0' gem 'rspec-core','= 2.7.1' gem 'rspec' #gem 'annotate-models' gem 'faker' gem 'therubyracer' end group :test do gem 'sqlite3-ruby','= 2.7.1' gem 'rspec' gem 'webrat' gem 'spork','= 0.9.0.rc9' gem 'factory_girl_rails' end group :production do gem 'pg' gem 'uglifier' end # To use debugger (ruby-debug for Ruby 1.8.7+,ruby-debug19 for Ruby 1.9.2+) # gem 'ruby-debug' # gem 'ruby-debug19',:require => 'ruby-debug'
这是我的Gemfile.lock:
GIT remote: git://github.com/alvatarc/carmen.git revision: af7bcd574e2f0ed6d59b46662a8be939a1e083c0 branch: 0.2.x specs: carmen (0.2.13) GEM remote: http://rubygems.org/ specs: RedCloth (4.2.9) actionmailer (3.1.11) actionpack (= 3.1.11) mail (~> 2.3.3) actionpack (3.1.11) activemodel (= 3.1.11) activesupport (= 3.1.11) builder (~> 3.0.0) erubis (~> 2.7.0) i18n (~> 0.6) rack (~> 1.3.6) rack-cache (~> 1.2) rack-mount (~> 0.8.2) rack-test (~> 0.6.1) sprockets (~> 2.0.4) activemodel (3.1.11) activesupport (= 3.1.11) builder (~> 3.0.0) i18n (~> 0.6) activerecord (3.1.11) activemodel (= 3.1.11) activesupport (= 3.1.11) arel (~> 2.2.3) tzinfo (~> 0.3.29) activeresource (3.1.11) activemodel (= 3.1.11) activesupport (= 3.1.11) activesupport (3.1.11) multi_json (~> 1.0) arel (2.2.3) aws-s3 (0.6.3) builder mime-types xml-simple aws-sdk (1.9.2) json (~> 1.4) nokogiri (>= 1.4.4) uuidtools (~> 2.1) builder (3.0.4) climate_control (0.0.3) activesupport (>= 3.0) cocaine (0.5.1) climate_control (>= 0.0.3,< 1.0) diff-lcs (1.1.3) erubis (2.7.0) exception_notification (3.0.1) actionmailer (>= 3.0.4) execjs (1.4.0) multi_json (~> 1.0) factory_girl (4.2.0) activesupport (>= 3.0.0) factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) faker (1.1.2) i18n (~> 0.5) gravatar_image_tag (1.1.3) hike (1.2.2) http_accept_language (1.0.2) i18n (0.6.4) jquery-rails (2.2.1) railties (>= 3.0,< 5.0) thor (>= 0.14,< 2.0) json (1.7.7) kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) libv8 (3.11.8.17) mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.23) multi_json (1.7.2) nokogiri (1.5.9) paperclip (3.4.1) activemodel (>= 3.0.0) activerecord (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.0) mime-types pg (0.15.1) polyglot (0.3.3) racc (1.4.9) rack (1.3.10) rack-cache (1.2) rack (>= 0.4) rack-mount (0.8.3) rack (>= 1.0.0) rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) rails (3.1.11) actionmailer (= 3.1.11) actionpack (= 3.1.11) activerecord (= 3.1.11) activeresource (= 3.1.11) activesupport (= 3.1.11) bundler (~> 1.0) railties (= 3.1.11) railties (3.1.11) actionpack (= 3.1.11) activesupport (= 3.1.11) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) rake (10.0.4) rdoc (3.12.2) json (~> 1.4) ref (1.0.4) right_aws (3.0.5) right_http_connection (>= 1.2.5) right_http_connection (1.3.0) rspec (2.7.0) rspec-core (~> 2.7.0) rspec-expectations (~> 2.7.0) rspec-mocks (~> 2.7.0) rspec-core (2.7.1) rspec-expectations (2.7.0) diff-lcs (~> 1.1.2) rspec-mocks (2.7.0) rspec-rails (2.7.0) actionpack (~> 3.0) activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.7.0) sass (3.2.8) sass-rails (3.1.7) actionpack (~> 3.1.0) railties (~> 3.1.0) sass (>= 3.1.10) tilt (~> 1.3.2) spork (0.9.0.rc9) sprockets (2.0.4) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1,!= 1.3.0) sqlite3 (1.3.7) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) therubyracer (0.11.4) libv8 (~> 3.11.8.12) ref thor (0.14.6) tilt (1.3.7) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.37) uglifier (2.0.1) execjs (>= 0.3.0) multi_json (~> 1.0,>= 1.0.2) uuidtools (2.1.3) webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) xml-simple (1.1.2) PLATFORMS ruby DEPENDENCIES RedCloth (>= 3.301) aws-s3 aws-sdk carmen! exception_notification factory_girl_rails faker gravatar_image_tag http_accept_language jquery-rails (~> 2.1) kaminari paperclip pg racc rails (= 3.1.11) right_aws rspec rspec-core (= 2.7.1) rspec-rails (= 2.7.0) sass-rails spork (= 0.9.0.rc9) sqlite3-ruby therubyracer uglifier webrat
解决方法
Does
bundle install
take specific gems in my Gemfile or Gemfile.lock?
bundle install首先进入gemfile.lock,然后查看gemfile以生成有效的gem列表,检查,尝试解析依赖关系,然后安装/更新gem.
My Gemfile and Gemfile.lock are not the same.
它们不需要是相同的. gemfile.lock是一个特定的文件,用于在运行bundle install / update时保持gem的状态.
Do I have to remove Gemfile.lock?
你可以,但随后捆绑安装将再次生成gemfile.lock.然后,您可能真的丢失并破坏所有gem依赖项,并且可能需要手动解决它们.
作为调查程序,您可以将旧的gemfile.lock复制到一个隐蔽的地方,然后重新生成gemfile.lock,并将其与diff进行比较