我不知道为什么bundler正在寻找actionpack-1.4.0.gem,但它导致我的bundle更新命令死了。
以下是所有相关的成绩单(据我所知......)
$ bundle update
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using Ascii85 (1.0.0)
/opt/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:145:in `initialize': Permission denied - /opt/local/lib/ruby/gems/1.8/cache/actionpack-1.4.0.gem (Errno::EACCES)
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:145:in `open'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:145:in `download'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:255:in `download_gem_from_uri'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:72:in `fetch'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:45:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:275:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13
from /opt/local/bin/bundle:19:in `load'
from /opt/local/bin/bundle:19
好的,所以它由于此路径上的权限被拒绝而失败,但那里没有文件:
/mydev/ElectionManager(export-work)> ls /opt/local/lib/ruby/gems/1.8/cache/actionpack-1.4.0.gem
ls: /opt/local/lib/ruby/gems/1.8/cache/actionpack-1.4.0.gem: No such file or directory
好的,让我们来看看环境。那里有什么可疑的吗?
/mydev/ElectionManager(export-work)> env
TERM_PROGRAM=Apple_Terminal
GEM_HOME=/opt/local/lib/ruby/gems/1.8
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/BF/BFIqAzICGVuMEvQQwzRkvE+++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-9H2vLV/Render
TERM_PROGRAM_VERSION=273.1
USER=pitosalas
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-4WmMHp/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin/
PWD=/mydev/ElectionManager
EDITOR=mate -w
LANG=en_US.UTF-8
PS1=\w$(__git_ps1 "(%s)")>
SHLVL=1
HOME=/Users/pitosalas
LOGNAME=pitosalas
DISPLAY=/tmp/launch-p24Csr/org.x:0
OLDPWD=/Users/pitosalas
_=/usr/bin/env
没什么好吃的。让我们看看所有代码,看看是否甚至提到了actionpack-1:
/mydev/ElectionManager(export-work)> grep -r -i "actionpack-1" .
/mydev/ElectionManager(export-work)>
没有提到它。什么是Gemfile?
$ cat Gemfile
source :gemcutter
#gem 'rails', "2.3.8"
gem 'rails'
gem "sqlite3-ruby", "1.2.5", :require => "sqlite3"
gem "authlogic"
gem "prawn", '>= 0.7.2'
gem 'will_paginate', '~> 2.3.11'
gem 'tpitale-constant_cache', '>= 0.1.2', :require => 'constant_cache'
gem 'rubyzip', '>= 0.9.4', :require => 'zip/zip'
gem 'redgreen', '>=1.2.2'
gem 'searchlogic', '>=2.4.14'
gem 'cancan'
gem 'fastercsv'
group :development do
end
group :test do
gem 'thoughtbot-shoulda', '>=2.10.2', :require => 'shoulda'
gem 'machinist'
gem 'faker'
gem 'mocha'
gem 'pdf-reader'
gem 'awesome_print'
gem 'turn'
gem 'rspec'
end
group 'cucumber' do
gem 'machinist'
gem 'faker'
gem 'cucumber-rails', '>=0.3.0', :require => false
gem 'database_cleaner', '>=0.5.0', :require => false
gem 'webrat', '>=0.7.0', :require => false
gem 'pickle', :require => false
end
group :production do
end
好的,看起来很不错。宝石认为它对rails gems有什么了解?
/mydev/ElectionManager(export-work)> gem list rails
*本地宝石*
rails (3.0.4, 2.3.8, 2.3.5, 2.3.4, 2.2.2)
rails_best_practices (0.6.4, 0.3.26, 0.3.19, 0.3.16)
/mydev/ElectionManager(export-work)>
答案 0 :(得分:1)
ActionPack是rails的依赖项。运行bundle install
会发生什么?这应该安装相关的actionpack
版本。
然而,它看起来似乎正在寻找actionpack
的旧版本。
在actionpack
中搜索Gemfile.lock
。这将告诉你它是什么依赖。
此外,如果bundler尝试安装到系统宝石,您可能需要sudo bundle install
,尽管最好给它一个安装路径:
bundle install --path=/something/specific/to/this/project
答案 1 :(得分:1)
您最初使用sudo gem install ...
安装了导轨吗?当bundle运行时没有sudo权限时,它将无法更新这些权限。删除最初安装的gem并重新运行bundler。