這個問題已經提出了幾次。過去的解決方案圍繞着沒有添加和提交的Git文件。如果通過所有帳戶,Git已經得到妥善處理並且仍然出現錯誤,應該怎麼辦?建築寶石 - InvalidSpecificationException [...]不是文件
rake aborted!
Gem::InvalidSpecificationException: ["Gemfile", "Gemfile.lock",
"lib/sysstandards/ext/abstract_interface.rb",
"lib/sysstandards/ext/mainframe_constants.rb",
"lib/sysstandards/ext/text_box_formatters.rb", "spec/ext",
"spec/ext/abstract_interface_spec.rb",
"spec/ext/text_box_formatters_spec.rb"] are not files
上面列出的所有文件都是新文件。他們被添加到存儲庫。他們承諾。該分支被定位爲掌握。孩子的分支合併成了主人。
[email protected] ~/RubymineProjects/SysStandards $ git status
On branch master
nothing to commit, working directory clean
這些文件顯示在git列表中。
[email protected] ~/RubymineProjects/SysStandards $ git ls-files
Gemfile
Gemfile.lock
...
lib/sysstandards.rb
lib/sysstandards/chgtable.rb
lib/sysstandards/ext/abstract_interface.rb
lib/sysstandards/ext/file_flocked.rb
lib/sysstandards/ext/load_params.rb
lib/sysstandards/ext/mainframe_constants.rb
lib/sysstandards/ext/text_box_formatters.rb
...
spec/ext/abstract_interface_spec.rb
spec/ext/text_box_formatters_spec.rb
我真的迷失在這一個。我看過類似的問題,並聽從他們的建議,但無濟於事。我無法繞過這個,因此,我無法得到建造的寶石。請讓我知道您可能需要的其他信息。
我正在刪除.git並從頭開始。但是,如果我這樣做,會有很多歷史丟失。我會等到星期一看看有沒有人有任何指導。但在週一,我想我會放棄Git並轉向Fossil。
感謝您的時間和考慮, DVN
更新發布顯示gemspec
spec = Gem::Specification.new do |s|
s.name = 'SysStandards'
s.version = '3.0.0'
s.has_rdoc = true
s.extra_rdoc_files = ['readme.md', 'LICENSE']
s.summary = 'Standards Library'
s.description = s.summary
s.author = 'Don V Nielsen'
s.email = '[email protected]'
# s.executables = ['your_executable_here']
s.files = %w(LICENSE readme.md Rakefile Gemfile Gemfile.lock Rakefile) + Dir.glob("{lib,spec}/**/*")
s.require_path = "lib"
s.bindir = "bin"
end
GEM
rake (12.0.0)
rspec (3.5.0)
PLATFORMS
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
x64-mingw32
x86-mingw32
BUNDLED WITH
1.10.6
更新與文件列表
[email protected] ~/RubymineProjects/SysStandards $ ls -l
total 40
drwx------ 2 dvn dvn 4096 Oct 30 11:16 coverage
drwxr-xr-x 2 dvn dvn 4096 Feb 23 09:46 doc
-rw-r--r-- 1 dvn dvn 139 Feb 23 12:20 Gemfile
-rw-r--r-- 1 dvn dvn 629 Feb 23 12:20 Gemfile.lock
drwxr-xr-x 3 dvn dvn 4096 Feb 23 12:20 lib
-rw-r--r-- 2 dvn dvn 65 Apr 1 2013 LICENSE
drwxr-xr-x 3 dvn dvn 4096 Feb 22 18:38 pkg
-rw-r--r-- 1 dvn dvn 1169 Feb 23 15:39 Rakefile
-rw-r--r-- 1 dvn dvn 890 Feb 23 12:20 readme.md
drwx------ 6 dvn dvn 4096 Feb 23 12:20 spec
[email protected] ~/RubymineProjects/SysStandards $ ls -l ./lib/sysstandards/ext
total 20
-rw-r--r-- 1 dvn dvn 1259 Feb 23 12:20 abstract_interface.rb
-rw-r--r-- 1 dvn dvn 388 Feb 23 12:20 file_flocked.rb
-rw-r--r-- 1 dvn dvn 345 Feb 23 12:20 load_params.rb
-rw-r--r-- 1 dvn dvn 540 Feb 23 12:20 mainframe_constants.rb
-rw-r--r-- 1 dvn dvn 1366 Feb 23 12:20 text_box_formatters.rb
[email protected] ~/RubymineProjects/SysStandards $ ls -l ./spec/ext
total 8
-rw-r--r-- 1 dvn dvn 747 Feb 23 12:20 abstract_interface_spec.rb
-rw-r--r-- 1 dvn dvn 941 Feb 23 12:20 text_box_formatters_spec.rb
那麼什麼是文件。符號鏈接
的異常是從下面的代碼寶石:: specification.rb拋出:
@files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
@test_files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
@executables.delete_if { |x| File.directory?(File.join(@bindir, x)) }
@extra_rdoc_files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
@extensions.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
non_files = files.reject { |x| File.file?(x) || File.symlink?(x) }
unless not packaging or non_files.empty? then
raise Gem::InvalidSpecificationException,
"[\"#{non_files.join "\", \""}\"] are not files"
end
@files進入這個代碼持有46項:文件和目錄。 @ files.delete_if應該刪除目錄,結果是剩餘的36個條目。間的36名倖存者是「規格/ EXT」,這是每「LS -l」的目錄:
[email protected] ~/RubymineProjects/SysStandards/spec $ ls -l
total 32
-rw-r--r-- 1 dvn dvn 1353 Feb 23 12:20 change_table_spec.rb
drwx------ 3 dvn dvn 4096 Oct 30 11:17 data
drwxr-xr-x 2 dvn dvn 4096 Feb 23 12:20 ext
當執行files.reject,結果是七個條目在non_files:所述一個目錄和六個文件。這是例外的原因。所以看起來File.symlink?正在引發這個問題。什麼是File.symlink,什麼值設置,值如何設置?
只是一個預感:我不認爲這是一個混帳問題,而是一個寶石建設問題。你可以發佈與s.files = ...和ruby,rake,bundler和gem版本的gemspec代碼片段嗎? –
ls -l顯示什麼? (錯誤消息中列出的各種子目錄也是'ls -l')。錯誤[當您嘗試添加非常規文件時出現](https://github.com/rubygems/rubygems/blob/v2.6.8/lib/rubygems/specification.rb#L2687 -L2692)。 – matt
文件列表如下: – donvnielsen