spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
812 stars 256 forks source link

Causes an error when deploy #170

Closed hopewise closed 6 years ago

hopewise commented 9 years ago

When I try to deploy my rails app at cloud66, I get this error:

rake aborted! ArgumentError: same file: /var/deploy/folder/web_head/releases/20150315170454/public/assets/tinymce/custom_content.css and /var/deploy/folder/web_head/releases/20150315170454/public/assets/tinymce/custom_content.css

Tasks: TOP => assets:precompile

Can you please help me how to fix this issue? Thanks

hopewise commented 9 years ago

I have cleared the assets folder, but now I get this error:

rake aborted! NoMethodError: undefined method each_key' for false:FalseClass /var/deploy/folder/web_head/shared/bundle/ruby/2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_manifest.rb:41:ineach' /var/deploy/folder/web_head/shared/bundle/ruby/2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_installer.rb:26:in cleanup_assets' /var/deploy/folder/web_head/shared/bundle/ruby/2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_installer.rb:13:ininstall' /var/deploy/folder/web_head/shared/bundle/ruby/2.2.0/gems/tinymce-rails-4.1.6/lib/tasks/tinymce-assets.rake:12:in `block in ' Tasks: TOP => assets:precompile

spohlenz commented 9 years ago

@hopewise: What version of Rails are you running (I'm guessing 3.x)? and what config.assets options do you have specified? After the compilation fails, is there a manifest file within public/assets?

hopewise commented 9 years ago

I am running Rails 4.1.6, config.assets options:

config.assets.compress = true config.assets.compile = true config.assets.digest = true

After the compilation fails, the manifest file within public/assets is empty or not there ,,

suratpyari commented 9 years ago

I am getting the similar issue.

rake aborted! NoMethodError: undefined method each_key' for nil:NilClass /Users/apple/.rvm/gems/ruby-2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_manifest.rb:97:ineach' /Users/apple/.rvm/gems/ruby-2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_installer.rb:26:in cleanup_assets' /Users/apple/.rvm/gems/ruby-2.2.0/gems/tinymce-rails-4.1.6/lib/tinymce/rails/asset_installer.rb:13:ininstall' /Users/apple/.rvm/gems/ruby-2.2.0/gems/tinymce-rails-4.1.6/lib/tasks/tinymce-assets.rake:12:in block in <top (required)>' /Users/apple/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:ineval' /Users/apple/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `

' Tasks: TOP => assets:precompile (See full trace by running task with --trace)

prpetten commented 9 years ago

+1 also getting this error.

mtmail commented 9 years ago

When I got this error the problem was that my project included a file called manifest

 cat app/assets/images/manifest.json
{
    "name": "name of my projectt",
    "icons": [
        {
            "src": "\/android-chrome-36x36.png",
            "sizes": "36x36",
            "type": "image\/png",
            "density": "0.75"
        },
        {
            "src": "\/android-chrome-48x48.png",
            "sizes": "48x48",
            "type": "image\/png",
              ...

tinymce/rails/asset_manifest.rb looks for the first manifest file it can find.

    def self.try(manifest_path)
      paths = Dir[File.join(manifest_path, "manifest*.json")]
      new(paths.first) if paths.any?
    end

I deleted my manifest file and it worked. The file got created by a favicon generator and I guess I accidentally checked it in.

hopewise commented 8 years ago

@spohlenz I am still having this problem, the only way I get over it is to delete manifest file at public/assets before run "rake assets:precompile" , how to solve this issue please?

spohlenz commented 8 years ago

@hopewise Could I please get you to upload a GitHub repository with a sample app that demonstrates the issue? Then I should be able to get to the bottom of it.

hopewise commented 8 years ago

I have deployed the app here: https://github.com/hopewise/tinymce-problem I highly appreciate your time :)

hopewise commented 8 years ago

Dear Sam, I've uploaded the same app to github so you can check the issue, here https://github.com/hopewise/tinymce-problem On Aug 15, 2015 7:31 AM, "Sam Pohlenz" notifications@github.com wrote:

@hopewise https://github.com/hopewise Could I please get you to upload a GitHub repository with a sample app that demonstrates the issue? Then I should be able to get to the bottom of it.

— Reply to this email directly or view it on GitHub https://github.com/spohlenz/tinymce-rails/issues/170#issuecomment-131293109 .

spohlenz commented 8 years ago

@hopewise I am seeing your original reported error in your example app. However it is coming from the non-stupid-digest-assets gem.

hopewise commented 8 years ago

so, what's the work around for this issue? what exact gem is that ?(non-stupid-digest-assets gem)

On Sat, Aug 15, 2015 at 3:03 PM, Sam Pohlenz notifications@github.com wrote:

@hopewise https://github.com/hopewise I am seeing your original reported error in your example app. However it is coming from the non-stupid-digest-assets gem.

— Reply to this email directly or view it on GitHub https://github.com/spohlenz/tinymce-rails/issues/170#issuecomment-131360710 .

Kind Regards,

Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East

spohlenz commented 8 years ago

It looks like non-stupid-digest-assets is a dependency of alchemy_cms. However alchemy_cms appears to include its own version of TinyMCE, which isn't something I can work around in this gem.

hopewise commented 8 years ago

So, is it possible to use alchemy_cms version of TinyMCE? On Aug 16, 2015 6:11 AM, "Sam Pohlenz" notifications@github.com wrote:

It looks like non-stupid-digest-assets is a dependency of alchemy_cms. However alchemy_cms appears to include its own version of TinyMCE, which isn't something I can work around in this gem.

— Reply to this email directly or view it on GitHub https://github.com/spohlenz/tinymce-rails/issues/170#issuecomment-131484371 .

philipqnguyen commented 8 years ago

Updating non-stupid-digest-assets to 1.0.5 seems to fix a similar problem for me. Give that a try =)

EmilyMB commented 6 years ago

Ran into this after upgrading then downgrading TinyMCE. The "solution" was to purge the cache (heroku repo:purge_cache -a appname) using the Heroku repo plugin since rake assets:clean and rake assets:clobber don't reliably work with the older versions of sprockets as discussed here.

hopewise commented 6 years ago

Currently, I simply delete the folder of TinyMCE at public folder before compile assets, and it work fine..