Error running Zurb foundation example in learn rails tutorial - ruby-on-rails

I'm working my way through Dan Kehoe's book 2 and everything was going well until I tried to run the Zurb Foundation example. Using Foundation 5 I get the error ".column" failed to #extend ".small-6".
The selector ".small-6" was not found.
Use "#extend .small-6 !optional" if the extend should be able to fail.
It seems as though I have not loaded something which defines the foundation css entities, but I am flumoxed as a complete newbie in ror. Any help would be greatly appreciated here. I've back tracked using git and tried it again, but I get the same thing. Thanks.
Frank

I had the same problem and modifying the Gemfile.lock solved the problem.
Specifically, I changed the version of foundation-rails, which was 6. etc to (5.5.3.2), resulting in foundation-rails (5.5.3.2).
This was the same version as specified in the GitHub repository of the author.
https://github.com/RailsApps/learn-rails/blob/master/Gemfile.lock (line61)
Hope it helps!

Related

Rails 4.2 + Ember => unexpected identifier

I'm following Vic Ramon's tutorial. I tried to use the latest version of Rails and Ember-source and I get the following error when visiting home page:
After clicking on link next to error I get this:
How can I fix that?
I ran the following commands:
rails g ember:bootstrap -n App --javascript-engine coffee
rails g ember:install
I removed turbolinks. I also created home controller and an empty view for home#index. Root is set to home#index. Also created following view file:
// app/assets/javascripts/templates/application.js.emblem
h1 Hello World
outlet
Ember gems im using:
Using emblem-source 0.3.18
Using ember-data-source 1.0.0.beta.14.1
Using ember-rails 0.16.1
Using emblem-rails 0.2.2
This could be due to some version incompatibilities between your versions of ember-related gems, as there were quite substantial changes in recent versions of ember (e.g. introduction of HTMLBars, etc.)
Your best bet is to clone the original repo and then try to upgrade individual gems and check if it still works after each upgrade. This way you will be able to identify the troubling gem.
I have verified that the original repo code indeed works with the versions of gems in its current Gemfile.lock.
If you are starting a new Rails + Ember app, ember-cli-rails is probably the way to go, giving you the best of both worlds.
Emblem was the culprit. Replacing .emblem with .handlebars fixed the problem. I tried the tip from emblem-rails git page and icluded
gem "emblem-source", github: "machty/emblem.js"
but that didn't change anything.
I also followed this tutorial (alongside a few others) and I encountered several issues alongside the way ranging from handling templates to setting up the JSON API. I don't see your entire source code so I cannot pinpoint the exact problem. However, it seems that we have similar projects, so you can compare your code to my blog project source code and see what is causing these issues. Comparing to Ramon's tutorial, my blog has implemented everything until chapter 15.
https://github.com/Deovandski/Fakktion/tree/Ember-Rails
If you are a beginner like myself, then I recommend avoiding CoffeeScript and Emblem and sticking to Javascript as much as possible for the first months because you will find more resources and examples. Also, let me know if you need assistance in setting up the project as I used .gitignore to hide things like secrets.yml

Setting up SublimeCodeIntel plugin to work with Rails/Ruby on Windows

I have spent the last 30 minutes trying to find examples on how to configure SublimeCodeIntel plugin on Sublime Text 2 to work with Rails / Ruby on windows. And even if it is stated in the documentation that it does support Rails, there is no example of the configuration.
From what I've read so far, getting Rubygems to work with this plugin is not possible, but rails should work. Has anybody successfully set up this plugin and if so, can you please help or share your configuration with me?
I would say most people either use VS Code these days for Go To Definition in Ruby Navigate to Ruby function definition in VS Code
Or RubyMine https://www.jetbrains.com/help/ruby/navigating-through-the-source-code.html#lens_mode_code

Ruby on Rails Tutorial Complete Files

I've got lost somewhere along the way with this tutorial (the one at ruby.railstutorial.org), and have an error in my code somewhere. Does anyone have the complete files for the completed application so that I can compare a working version to mine? Thanks!!
you can find the files here on github

How to update rails 3.0.3 to 3.1?

How do I update to Rails 3.1 ?
I am using windows xp with ruby console.
And is there a smart way to update a rails app from 3.0.3 to 3.1 or do I need to rewrite it all?
This question has a lot of useful information which might help you out: Upgrading from Rails 3 to Rails 3.1
It doesn't answer specifically for Windows, but there's a lot of advice and insight that you'll find useful for the upgrade.
The only advice I can offer on top of reading the answers in the above question is to have a bit of patience and not expect it to work straight away. There's a lot of changes in the way 3.1 works so expect to spend some time fixing it up.
Good luck!
I created one vanilla 3.0 site, added it to Git, then created a vanilla 3.1 site and copied it over the 3.0 site, deleting existing files first. A diff then showed me exactly what changed.
I would strongly recommend this and the following two railscasts in the series

Starting out with vote_fu

Trying my luck with the vote_fu rails plugin. The functionality looks like exactly what I need for a project of mine, but I have hit a roadblock. I have followed the github readme to the letter, installing it as a plugin.
I have put acts_as_voteable on my "Event" model and acts_as_voter on my User model.
In the console, when I try:
>> event.votes
or
>> user.votes
it successfully returns an empty array.
but when I try to do the following:
user.vote_for(event)
I get
"NoMethodError: undefined method `user_id' for #<Vote:0x7f5ed4355540>"
Any ideas? I'm probably just missing something obvious, but maybe something is missing from the plugin's readme.
Thanks.
[Update]
I created a blank application and the plugin works fine, so I think that this problem might be being caused by the use of the "desert" plugin, as my User class is split over two files. If I find the answer, I'll post it so that in the off chance someone else runs into this it may be some help.
Cheers.
Ok, I haven't found a definitive reason why this problem occurred, but I do have strong suspicions that it is due to the use of the "desert" plugin, as my User class is split over two files (the project is using the CommunityEngine plugin as a base),
Anyhow, I found a work around (something I should have tried before posting here). Instead of installing vote_fu as a plugin, I installed it as a gem. And now vote_fu seems to be humming along nicely.
So let that be a lesson to you all!
:-P

Resources