Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails 6 support #61

Open
vpereira opened this issue Aug 22, 2019 · 3 comments
Open

rails 6 support #61

vpereira opened this issue Aug 22, 2019 · 3 comments

Comments

@vpereira
Copy link

Hi, trying to update a rails from 5.2 to 6.0 and codemirror-rails is blocking it.

from bundle update rails I get the following error:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    codemirror-rails was resolved to 5.16.0, which depends on
      railties (< 6.0, >= 3.0)
@fixlr
Copy link
Owner

fixlr commented Aug 22, 2019

Hi @vpereira. I'm not planning on updating this gem for modern versions of Rails. This gem was created during a time long before we had official support for managing JavaScript dependencies via yarn, and it contains no other ruby code that would require it to be distributed as a gem.

If you're maintaining a Rails application that is configured with yarn, I would recommend using the official codemirror package instead.

If you haven't configured npm or yarn, and don't want to, the official codemirror releases have always been available at codemirror.net. You can download the latest release, unzip it, and copy the files you need into vendor/assets/.

kirichkov added a commit to simplicitybg/comfortable-mexican-sofa that referenced this issue May 26, 2021
- Replaces paperclip with kt-paperclip
- Removes dependency on codemirror-rails - no longer supported, see fixlr/codemirror-rails#61
@epugh
Copy link

epugh commented Sep 11, 2022

Would it be worth archiving this project to indicate that it's no longer being updated?

@jaigouk
Copy link

jaigouk commented Sep 29, 2022

for rails 6 without adding raw package in vendor/assets, I used npm package

app/assets/javascripts/application.js

//= require jquery
//= require codemirror/lib/codemirror

//= require_tree .

config/webpack/environment.js

const { environment } = require('@rails/webpacker')
const webpack = require('webpack')

// // Adds `var CodeMirror = require('codemirror') to legacy codemirror plugins
environment.plugins.append(
  'Provide',
  new webpack.ProvidePlugin({
    CodeMirror: 'codemirror/src/codemirror',
    CodeMirror: 'codemirror/src/codemirror',
  }),
)
module.exports = environment

package.json

"codemirror": "^5.65.9"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants