Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Redactor插入图像CMS(舒适的墨西哥沙发)_Ruby On Rails_Image_Content Management System_Redactor_Comfortable Mexican Sofa - Fatal编程技术网

Ruby on rails Redactor插入图像CMS(舒适的墨西哥沙发)

Ruby on rails Redactor插入图像CMS(舒适的墨西哥沙发),ruby-on-rails,image,content-management-system,redactor,comfortable-mexican-sofa,Ruby On Rails,Image,Content Management System,Redactor,Comfortable Mexican Sofa,我已经采取了现有的网站。集成了一个舒适的墨西哥沙发。然后安装Redactor。我有能力添加内容并在localhost:3000上显示它。我也有能力上传文件。我在内容框中使用其插入图像功能时遇到问题 我的服务器日志: Started POST "/admin/sites/2/pages/2/null?ajax=1" for 127.0.0.1 at 2015-09-22 01:26:44 -0400 ActionController::RoutingError (No route mat

我已经采取了现有的网站。集成了一个舒适的墨西哥沙发。然后安装Redactor。我有能力添加内容并在localhost:3000上显示它。我也有能力上传文件。我在内容框中使用其插入图像功能时遇到问题

我的服务器日志:

    Started POST "/admin/sites/2/pages/2/null?ajax=1" for 127.0.0.1 at 2015-09-22 01:26:44 -0400

ActionController::RoutingError (No route matches [POST] "/admin/sites/2/pages/2/null"):
  actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.0.3) lib/rails/engine.rb:511:in `call'
  railties (4.0.3) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
  /Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
  /Users/bam/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
我的Gemfile的相关Gems我没有向Gemfile添加imagemagick,尽管我已经安装了它

ruby '2.0.0'
gem 'rails', '4.0.3'

gem "paperclip", "~> 4.3.0"
gem 'comfortable_mexican_sofa', '~> 1.12.0'
gem 'kaminari'
配置/环境/开发

  # Per https://github.com/thoughtbot/paperclip
  Paperclip.options[:command_path] = "/usr/bin/"
路线

  comfy_route :cms_admin, :path => '/admin'
  # Make sure this routeset is defined last
  comfy_route :cms, :path => '/', :sitemap => false
config/initializers/paperclip.rb

Paperclip.options[:command_path] = "/usr/bin/"
当我上传文件并且上传成功时,这是服务器日志的前两行,差异出现在第2行

Started POST "/admin/sites/2/files?ajax=true" for 127.0.0.1 at 2015-09-22 01:48:10 -0400
Processing by Comfy::Admin::Cms::FilesController#create as HTML
请随意签出回购协议。我不确定如何演示Redactor添加的文件。该分支是一个编辑

请毫不犹豫地评论这篇文章——这是我的第一篇文章


谢谢

事实证明,新版舒适墨西哥沙发配有redactor。根据我们的Ruby版本,它默认为旧版本。升级gemset解决了这个问题。

另一个给我的选择是你可以在​文件夹​ 部分,然后参考默认页面编辑器中的图像。上传图像后,CMS会在编辑器右侧添加一个“上传文件”模块,您可以在其中复制和粘贴图像URL以创建标记。埃德·托罗