在将redbox插件安装到rails时为什么会说找不到插件?

时间:2009-02-26 14:04:49

标签: ruby-on-rails ruby plugins

当我尝试安装redbox插件时,虽然一切都已安装,但最后一行表示找不到插件。那是为什么?

script/plugin install http://svn2.cvsdude.com/craigambrose/plugins/redbox
+ ./README
+ ./Rakefile
+ ./images/redbox_spinner.gif
+ ./init.rb
+ ./install.rb
+ ./javascripts/redbox.js
+ ./lib/redbox.rb
+ ./lib/redbox_helper.rb
+ ./stylesheets/redbox.css
+ ./tasks/redbox_tasks.rake
+ ./test/redbox_test.rb
Plugin not found: ["http://svn2.cvsdude.com/craigambrose/plugins/redbox"]

1 个答案:

答案 0 :(得分:2)

vendor/plugins/redbox/install.rb内的路径似乎有误:

plugins_dir = File.expand_path(".")
redbox_dir = File.join(plugins_dir, 'redbox')
root_dir = File.join(redbox_dir, '..', '..', '..')

File.copy File.join(redbox_dir, 'javascripts', 'redbox.js'), File.join(root_dir, 'public', 'javascripts', 'redbox.js')
File.copy File.join(redbox_dir, 'stylesheets', 'redbox.css'), File.join(root_dir, 'public', 'stylesheets', 'redbox.css')
File.copy File.join(redbox_dir, 'images', 'redbox_spinner.gif'), File.join(root_dir, 'public', 'images', 'redbox_spinner.gif')

redbox_dir路径不考虑vendor/plugins路径组件。但您可以通过手动将上面列出的三个文件从vendor/plugins/redbox目录复制到应用程序public目录下的相应子目录来自行完成安装。