Question

I tried googling for a rails 4 version of Middleman but came up empty-handed. Is there a way to get middleman to work with Rails 4? Whenever I try to start my server now it says:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/middleman-0.13.1/lib/middle
man/vendor/gems/environment.rb:3: Use RbConfig instead of obsolete and deprecate
d Config.

Is there a way to fix this, or is there a middleman-equivalent that does work with rails 4?

edit: P.S Slimgems didn't work :(

Was it helpful?

Solution

Middleman is a tool for building static websites, but with your own tools like Ruby, Coffeescript and Slim. This will be compiled to html/css/js. It's a great tool but it is not in anyway depended on Rails (4).

Middleman process

It's a gem, to install just type

    gem install middleman

Now you can create a new project

    middleman init awesomeproject

Now you're ready to build a static website, you can view the changes with the middleman server

    middleman server

When you've finished your static website

    middleman build

and your website will be compiled to HTML/CSS/JS, which can be placed on any server that you have.

I think you've combined those two things (Middleman with Rails) and this is giving you this wierd error.

OTHER TIPS

Adding to Loed's answer, I'd say that middleman is also a great tool for the front-end work in a rails app. The designers can work with views, with example data, and middleman enables correct view/model separation. As the views/templates can be written in any Tilt-compatible language (erb, haml, slim, ...) and they get their data from a sort of 'data' local variable, the templates can be moved to a rails app with no effort (except that the controllers should expose a similarly structured data local to the views.)

The data provided in the /data/somefile.yml files is the ideal blueprint to build up decorators, and the process of integrating layouts in a rails app (usually long, tedious and error-prone) is greatly simplified.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top