Category Archives: Ruby

Redcarpet errors when using Yard or Changing Yards markup provider

* Note, I’m not going to talk about how to make Redcarpet work. Instead I’m going to explain how to get Yard generating documentation again with a redcarpet alternative.

Maybe I’ve just been unlucky but I’ve had a number of run ins with Redcarpet when using Yard over the years. I’ve learned that Yard can use a number of markup-providers besides the Redcarpet gem.

For search purposes, here’s the verbage for my current scuffle with Redcarpet:

[error]: Missing ‘redcarpet’ gem for Markdown formatting. Install it with `gem install redcarpet`

To replace that redcarpet dependency:

1) generate a /.yardopts file if it doesn’t already exist. Any configuration you provide in there will be picked up regardless if you run yard directly or some Rake task calls yard with additional parameters.

2) Append a parameter to change the markup-provider.

--markup-provider <some markup-provider>

Screen Shot 2015-03-05 at 10.39.01 AM

More options for a markup-provider beyond rdiscount are listed at: http://www.rubydoc.info/gems/yard/YARD/Templates/Helpers/MarkupHelper

3) Finally, ensure your Gemfile lists your new markup-provider.

Screen Shot 2015-03-05 at 11.47.04 AM

Posted in Code, Ruby | Leave a comment

RVM error on OSX: Can not find compiler and ‘make’ tool

Running afoul of the following error when trying to install rubies with RVM despite having installed Xcode?

Can not find compiler and ‘make’ tool – make sure Xcode and/or Command Line Tools are installed.

With newer versions of Xcode the command line tools RVM expects are not automatically installed alongside Xcode.

Open Xcode and navigate to: Xcode > Preferences > Downloads and click Install for Command Line Tools.

Posted in Code, OS X, Ruby | Leave a comment

Error: “Association named ‘spree_roles’ was not found; perhaps you misspelled it?”

ActiveRecord::ConfigurationError:
Association named ‘spree_roles’ was not found; perhaps you misspelled it?

I ran into this error while developing an extension for Spree 1-3-stable and writing request specs to run on the dummy test app generated via bundle exec rake test_app. You may have also run into this error on a normal Spree app if you installed Spree in your Rails apps using just your Gemfile and bundler instead of spree install <my_store>.

Regardless, this is an issue with Spree not setting the correct user model in the spree initializer during install. To correct this, update config/intializers/spree.rb to use:

Spree.user_class = "Spree::User"

instead of

Spree.user_class = "Spree::LegacyUser"

If you’re having this issue with the dummy test app in spec/dummy, just do the same for the dummy app’s initializer: spec/dummy/config/initializers/spree.rb

For more information:
See the issue for dummy test_apphttps://github.com/spree/spree/issues/1966
See the issue for regular Spreehttps://github.com/radar/spree_auth_devise/issues/1

Posted in Code, Ruby, Spree | 2 Comments