Code Monkey home page Code Monkey logo

learn-rails's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-rails's Issues

Top bar not displaying navigation links at small browser widths (Foundation 5.1)

I'm using the latest version of the book, at narrow page widths my menu bar isn't showing a drop-down menu, Googling tells me that this is a problem with foundation (fixed in a newer release 5.03?), I gave gem update a whirl.

I'm only posting here as the troubleshooting tip hasn't fixed the issue, which may frustrate future readers.

Response code 403 for post https://www.google.com/accounts/ClientLogin: Error=BadAuthentication

I'm working through the spreadsheet connection section of the rails tutorial but am unable to submit the contact form. Here's a screen shot of the error.

image

Here's the secrets.yml file. My email password does have a hyphen, could that be a factor?

development:
email_provider_username: <%= ENV["email"] %>
email_provider_password: <%= ENV["pwd"] %>
mailchimp_api_key: <%= ENV["key"] %>
mailchimp_list_id: <%= ENV["ID"] %>
domain_name: example.com
owner_email: <%= ENV["email"] %>
secret_key_base: super long string

test:
secret_key_base: very_long_random_string

Do not keep production secrets in the repository,

instead read values from the environment.

production:
email_provider_username: <%= ENV["email"] %>
email_provider_password: <%= ENV["pwd"] %>
mailchimp_api_key: <%= ENV["key"] %>
mailchimp_list_id: <%= ENV["key"] %>
domain_name: <%= ENV["DOMAIN_NAME"] %>
owner_email: <%= ENV["email"] %>
secret_key_base: <%= ENV["super long string"] %>

Here's my bash profile:

Added by the Heroku Toolbelt

export PATH="/usr/local/heroku/bin:$PATH"

export GMAIL_USERNAME=“email"
export GMAIL_PASSWORD=“pwd”
export MAILCHIMP_API_KEY="key"
export MAILCHIMP_LIST_ID="key"
export OWNER_EMAIL=“email"
export SECRET_KEY_BASE="long string"

Update compass-rails version since 2.0.alpha.0 has been yanked

compass-rails 2.0.alpha.0 has been yanked from rubygems.org and so running bundle install produces the following error:

Could not find gem 'compass-rails (~> 2.0.alpha.0) ruby' in the gems available on this machine.

Looking at #10, it seems like this will NOT be an issue once Zurb 5 is supported (since compass-rails might NOT be needed anymore). In the meantime, it would be nice to know if an older version of compass-rails can be used and avoid going though the hoops of force-installing the yanked gem version.

Hitting road block to deploy

I'm getting this error whenever I'm trying to commit to Github after I input git add:

fatal: Unable to create '/home/action/workspace/learn-rails/.git/index.lock': Disk quota exceeded

Unless I'm mistaken I have one other project going on which is One Month Rails.. but I'm pretty sure it wouldn't fill up my entire quota on Nitrous.io

Dynamic Home Page chapter

the page wont load on the localhost, upon making the visitors_controllers and etc.

ActionView::MissingTemplate at /
Missing template visitor/new with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:

  • "/Users/hieu/.rbenv/versions/2.2.0-dev/lib/ruby/gems/2.3.0/gems/web-console-2.0.0/lib/action_dispatch/templates"
  • "/Users/hieu/railsapp/learn-rails/app/views"
  • "/Users/hieu/.rbenv/versions/2.2.0-dev/lib/ruby/gems/2.3.0/gems/foundation-rails-5.5.1.0/app/views"

create methods in controllers cause root to load multiple times.

Hi Daniel!

I've followed the book closely and the app is working great (https://sr-learn-rails.herokuapp.com/).

When I installed the analytics feature through segment.io (Ch. 26) I noticed a strange behavior on my segment debugger dashboard:
Whenever a form event is triggered (sign up or contact request) the user is redirected to the root (as intended) but the page is loaded 3 times. The same behavior happens when you load the app using the URL (not the nav links).

I attached a screenshot of my segment dashboard to give you some context.

Any idea why this is happening?

Note: The console.log line you wrote in the segmentio.js file is also printed 2 times when an event is triggered.

image

ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 18 column 1 (Psych::SyntaxError)

Hi I checked the issues to see if anyone else is having this issue, seems not.

I'm working on a Rails application tutorial and have had the above error come up several times. When I was getting this error it seemed to only be a problem if I used one particular terminal window. I have since restarted the computer and now it is a problem regardless of what I do.

I went to the project on github and copied the information in 'secrets.yml' into my file in case that was the issue but doesn't help. In fact I'm not sure if that is even the file causing the problem because when I shift the code in that file and save it I still get the same error; at those times it points to a line that is now blank in the 'secrets.yml'

I suspect it is to do with the 'secret' file or could it be changes the tutorial told me to make to my .bash_profile. Could that be causing the problems? If so, how would I know?
Is there a way to isolate and figure out what is causing the problem?

thank you

'rails generate figaro:install' fails with missing database.yml

First, thanks so much for writing this book.

When I run
rails generate figaro:install
this error complaining about the absence of a database.yml file in the config directory appears:
`database_configuration': Could not load database configuration. No such file /path/to/project/config/database.yml

I tried placing an empty database.yml in that location just in case it only needed it to be there and didn't need to read any configuration, but no luck.

Did I miss a step somewhere?

Update compass-rails version since 2.0.alpha.0 has been yanked

Hello Guys,
I'm pushing Myapp for Heroku and I have a error.
Well when I run this:

$ git push heroku master

I have this error:
Could not find compass-rails-2.0.alpha.0 in any of the sources
Bundler Output: Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Could not find compass-rails-2.0.alpha.0 in any of the sources
!
! Failed to install gems via Bundler.
!

! Push rejected, failed to compile Ruby app

To [email protected]:aprendendo-rails.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:aprendendo-rails.git'

Analytics with Segment.io

To begin with, great material!

The segment.io dashboard doesn't change. After following the instructions in the tutorial, it still shows that you need to setup segment.io.

Contact Form > Model page 201

Hi Daniel,
Thanks for your tutorial, it was the only thing that kept me from giving up on Rails.

On page 201, I received an error with the following code:

validates_format_of :email,
:with => /\A[-a-z0-9_+.]+@([-a-z0-9]+.)+[a-z0-9]{2,4}\z/i

I was able to work around it using a tool you recommended (Dash) with the following:

validates_format_of :email, with: /\A[-a-z0-9_+.]+@([-a-z0-9]+.)+[a-z0-9]{2,4}\z/i

Thanks again for all you do to help the beginners.
Jeff

uninitialized constant VisitorsController::Owner

On pages 96/97 I'm trying to test my application w/ the simple Foobar Kadigan homepage and I'm getting the error:

uninitialized constant VisitorsController::Owner

I've double and triple checked everything, re-typed by hand, then just straight copied from the pdf and still nothing.

Problem with application.yml (Rails 4.0)

Hey Daniel.

In Chapter 12, I have to put in my Gmail and MailChimp info.
In my Gmail I have punctuation marks, but I'm not sure how to put quotation marks around it correctly.

As of now I've tried to put double quotation marks around the entire line, like "[email protected]"

However I still get this error when trying to run the rails s command:
error

I can't use the code from Github since it's left blank.
I'm on Nitrous.io if it matters?

My Github repository can be found here:
https://github.com/mho-rails/learn-rails

Installing rvm on Nitrous.io

Hello Daniel,
i have followed the 3 steps to install rvm on Nitrous:

  1. Uninstall chruby
  2. $ \curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --ruby
  3. source /home/action/.rvm/scripts/rvm
    I get the error message "-bash: /home/action/.rvm/scripts/rvm: No such file or directory"
    I checked home/action/.rvm and the directory scripts is not present.

Could you help me here?
shalini

Gemfile

Hi there, I'm trying to update my Gemfile to prepare for deployment and keep getting the following error

Gemfile syntax error:
gem 'rails', '4.0.2'...s.org'

I'm using rails 4.0.2.

Page 53 - Where do gems Live?

The command "rvm gemset use learn-rails" doesn't change as the tutorial.

Tutorial page 53:

$ gem which bundler
/Users/me/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.5/lib/bundler.rb
$ gem which rails
/Users/me/.rvm/gems/ruby-2.0.0-p0@learn-rails/gems/railties-4.0.0/lib/rails.rb

my case (following the tutorial):

leonardotsuda:learn-rails/ (master✗) $ gem which bundler [16:27:27]
/Users/leonardotsuda/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb
leonardotsuda:learn-rails/ (master✗) $ gem which rails [16:27:34]
/Users/leonardotsuda/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails.rb
leonardotsuda:learn-rails/ (master✗) $ rvm gemset use learn-rails [16:27:44]
Using ruby-2.0.0-p247 with gemset learn-rails
leonardotsuda:learn-rails/ (master✗) $ gem which rails [16:28:34]
/Users/leonardotsuda/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails.rb
leonardotsuda:learn-rails/ (master✗) $

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

http://stackoverflow.com/questions/5720484/how-to-solve-certificate-verify-failed-on-windows

solved with answer 6

Actually the best way I found to solve this in windows for Ruby itself, not just one gem, is to do the following:

Download http://curl.haxx.se/ca/cacert.pem into c:\railsinstaller\cacert.pem
Go to your Computer -> Advanced Settings -> Environment Variables

Create a new System Variable:

Variable: SSL_CERT_FILE

Value: C:\RailsInstaller\cacert.pem

Close all your command prompts, including your Rails server command prompt, etc. Start a new ruby irb prompt, and try the following:

$irb>require 'open-uri'
$irb>open('https://www.gmail.com')

It should all work now just fine.

uninitialized constant Contact::GoogleDrive

Great book! Have really enjoyed it.

Something I can't seem to figure out.

page. 174-176.

I implemented:

def update_spreadsheet
connection = GoogleDrive.login(ENV["GMAIL_USERNAME"], ENV["GMAIL_PASSWORD"])
ss = connection.spreadsheet_by_title('Learn-Rails-Example')
if ss.nil?
ss = connection.create_spreadsheet('Learn-Rails-Example')
end
ws = ss.worksheets[0]
last_row = 1 + ws.num_rows
ws[last_row, 1] = Time.new
ws[last_row, 2] = self.name
ws[last_row, 3] = self.email
ws[last_row, 4] = self.content
ws.save
end

...and I have my gmail username and password correct at application.yml, but i still get...
NameError at /contacts
uninitialized constant Contact::GoogleDrive ...when trying to submit my contact form.

Any ideas why this might be? Thanks so much!

foundation-rails v5.4.4.0 fails

Upgrading to foundation-rails v5.4.4.0 (released 15 Sept 2014) fails due to a Sass compile issue. When visiting a page, the error is:

     ActionView::Template::Error:
       Invalid CSS after "...odules, $name) ": expected "}", was "!global;"
         (in /Users/danielkehoe/workspace/wip/rails-foundation/app/assets/stylesheets/framework_and_overrides.css.scss:13)

The workaround is to specify an earlier version of foundation-rails in the Gemfile and run bundle update:

gem 'foundation-rails', '5.4.3.1'

See foundation/foundation-sites#5811

sending and receiving email remains same for gmail

I configured email settings with gmail account.When a user is adding his contact data, it sending email to site owner gmail [example.gmail.com] account and showing to and from email, the same account [example.gmail.com] ,though log is showing, email is sending from users account. I cant figured it out.

Menu does not display drop down in 'Front-End Framework' chapter

Hi Daniel

On page 174 in learn-rails when I re sizes the webpage I can see the menu icon but when I click on it, I don't see a drop down. Yet my code is the same as yours in the application.js file.

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require foundation
//= require_tree .
$(function() {
  $(document).foundation();
});

Am just wondering if this is really the expected behaviour as I tried to do some debugging and I came across this line in the navigation partial file:

<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>

In the a tag it links to nothing, so when I click on the drop down menu there should be no drop down link right?

Quick update after playing around with this for 15 minutes I came up with a bad solution but it works 😄
I added the line of code below to _navigation_links partial:

<li><%= link_to 'Home', root_path %></li>

The problem here is that the home link shows up twice on the navigation bar. From what I understand that should not happen as I have included the link above in the links file not navigation file.

Thanks Adam

"Front-End Framework" chapter derailment

My app looked fine in the browser at the end of the chapter "Layouts and Views." In the chapter "Front-End Framework" I ran:

$ rails generate layout:install foundation5 --force

I see the file

app/assets/stylesheets/framework_and_overrides.css.scss

and I don't see the file

app/assets/stylesheets/simple.css

So I know that the "install foundation5" ran.

In the browser window I see an error screen with two errors (attached).

In the terminal I see this error message, followed by lots of lines starting with "sass":

Sass::SyntaxError - Invalid CSS after "...ules: $modules ": expected "}", was "!global;"

In looking at the terminal, I see that "install foundation5" removed two files not mentioned in the book:

app/assets/stylesheets/application.css
app/assets/stylesheets/bootstrap_and_overrides.css.scss

I also found that after using "git reset --hard" one new file remained:

app/assets/stylesheets/framework_and_overrides.css.scss

With this file I get the error messages. When I delete this file my old webpage comes back.

Any suggestions?
screen shot 2015-03-02 at 5 13 03 pm
screen shot 2015-03-02 at 5 13 14 pm

uninitialized constant VisitorsController::Visitor during Mailing List Chapter

I have ran into an issue just after implementing the Mailing List chapter, here is my code:

Visitor.rb
class Visitor < ActiveRecord::Base
has_no_table
column :email, :string
validates_presence_of :email
validates_format_of :email, :with => /\A[-a-z0-9_+.]+@([-a-z0-9]+.)+[a-z0-9]{2,4}\z/i

def subscribe
mailchimp = Gibbon::API.new
result = mailchimp.lists.subscribe({
:id => ENV['MAILCHIMP_LIST_ID'],
:email => {:email => self.email},
:double_optin => false,
:update_existing => true,
:send_welcome => true
})
Rails.logger.info("Subscribed #{self.email} to MailChimp") if result
end

end

Routes.rb

LearnRails::Application.routes.draw do

The priority is based upon order of creation: first created -> highest priority.

See how all your routes lay out with "rake routes".

You can have the root of your site routed with "root"

resources :contacts, only: [:new, :create]
resources :visitors, only: [:new, :create]
root 'visitors#new'

Visitors_controller

class VisitorsController < ApplicationController

def new
@visitor = Visitor.new
end

def create
@visitor = Visitor.new(secure_params)
if @visitor.valid?
@visitor.subscribe
flash[:notice] = "Signed up #{@visitor.email}."
redirect_to root_path
else
render :new
end
end

private

def secure_params
params.require(:visitor).permit(:email)
end

end

Problem with gems due to formatting of Gemfile

Hey Daniel,

I'm at the point where I finished up the configuration module, but when I pushed the Github and tried to go to the next chapter while start the server, I encounter this error...

I'm not sure where I went wrong as I thought I followed your instructions.. I even referenced what you have in your github account for the learn rails app..

Would appreciate any feedback - thanks!

/home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require': /home/action/work 38: syntax error, unexpected tIDENTIFIER, expecting keyword_end (SyntaxError) from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inblock in requi
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependenc from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inrequire'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/engine.rb:591:in block (2 levels) in <class:Engine> from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/engine.rb:590:ineach'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/engine.rb:590:in block in <class:Engine>' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:30:ininstance_exec'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:30:in run' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:55:inblock in run_initializers'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in block in tsort_each' from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:inblock (2 levels) in each_strongly_connected_component'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in block (2 levels) in each_strongly_connected_component_from' from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:ineach_strongly_connected_component_from'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in block in each_strongly_connected_component_from' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:44:ineach'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:44:in tsort_each_child' from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:ineach_strongly_connected_component_from'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in block in each_strongly_connected_component' from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:ineach'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in each_strongly_connected_component' from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:intsort_each'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/initializable.rb:54:in run_initializers' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/application.rb:215:ininitialize!'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/railtie/configurable.rb:30:in method_missing' from /home/action/workspace/learn-rails/config/environment.rb:5:in<top (required)>'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inblock in requi
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependenc from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:inrequire'
from /home/action/workspace/learn-rails/config.ru:3:in block in <main>' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:55:ininstance_eval'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in initialize' from /home/action/workspace/learn-rails/config.ru:innew'
from /home/action/workspace/learn-rails/config.ru:in <main>' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:49:ineval'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:49:in new_from_string' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:40:inparse_file'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:277:in build_app_and_options_from_config' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:199:inapp'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/commands/server.rb:48:in app' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:314:inwrapped_app'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/commands/server.rb:75:in start' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/commands.rb:76:inblock in <top (required)>'
from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/commands.rb:71:in tap' from /home/action/.rvm/gems/ruby-2.0.0-p247@learn-rails/gems/railties-4.0.1/lib/rails/commands.rb:71:in<top (required)>'
from bin/rails:4:in require' from bin/rails:4:in

'

Menu does not display drop down in 'Add pages' chapter

Hi Daniel

On page 180 in learn-rails (last version 1.19) when I resize the webpage I can see the menu icon but when I click on it, I don't see a drop down. Yet my code is the same as yours in the application.js file.

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require foundation
//= require_tree .
$(function() {
$(document).foundation();
});

This was already discussed in closed issue #6 but it still does not work for me and I have no idea why.

Any clue?

Using Gmail from Heroku - port settings were different

Hello,

First of all - loving the tutorial.

I hit a snag in using the Contact form once deployed to Heroku. I resolved it from an answer on StackOverflow and wondered if anyone else hit the same problem.

The 'Enable Email' section of the tutorial adds this:

config.action_mailer.smtp_settings = { port: 587 }

to config/environments/production.rb

I submitted the Contact form on Heroku and got this error in the logs:

Errno::ECONNREFUSED (Connection refused - connect(2) for "localhost" port 25):

When I changed the config/environments/production.rb to this:

config.action_mailer.smtp_settings = { port: 25 }

and pushed to Git & Heroku, the contact form worked.

Thanks,

Jonathan

unknown attribute: user_id

class Contact < ActiveRecord::Base

#has_no_table

#column :name, :string
#column :email, :string

column :content, :string

#validates_presence_of :content
#validates_length_of :content, :maximum => 500

belongs_to :user

belongs_to :profile

end

class User < ActiveRecord::Base

Include default devise modules. Others available are:

:confirmable, :lockable, :timeoutable and :omniauthable

devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_one :profile , dependent: :destroy
has_many :contact
accepts_nested_attributes_for :profile

end

class Profile < ActiveRecord::Base
belongs_to :user

end

uninitialized constant VisitorsController

I am getting an error:

uninitialized constant VisitorsController

Here is my file app/models/owner.rb:

class Owner < ActiveRecord::Base

  def name
    name ='Asim'
  end

  def birthdate
    birthdate = Date.new(1990,9,22)
  end

  def countdown
    today = Date.today
    birthday = Date.new(today.year, birthdate.month, birthdate.date)
    countdown = (birthday - today).to_i
  end

end

Here is my file app/controllers/visitors_controller.rb:

class VisitorsController < ApplicationController
  def new
    @owner = Owner.new
  end
end

Here is my file config/routes.rb:

LearnRails::Application.routes.draw do
  root :to => 'visitors#new'
end

Please can you help me?

Ch 21: Add Pages: Navigation bar links font sizes inconsistent

I'm finding the Home link is displayed (by the Chrome browser) in a larger font size than the About and Contact links. Is that expected?

I'm trying to follow the tutorial exactly. Home is defined in app/views/layouts/_navigation.html.erb, while About and Contact are in app/views/layouts/_navigation_links.html.erb.

I have ruby 32.0.1700.107, and rails 4.0.2, and version 1.c16 of the Learn Ruby on Rails book.

Regards,
Donald Cameron

Open SSL Error

Hi when I attempt to add a new email i get an error stating SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
highlighting these two lines

1 validates_format_of :email, :with => /\A[-a-z0-9_+.]+@([-a-z0-9]+.)+[a-z0-9]{2,4}\z/i
2 def subscribe
3 mailchimp = Gibbon::API.new
4 result = mailchimp.lists.subscribe({

the first and the fourth, any idea what I might be missing?

Thanks

Error: "Could not find rake-10.2.2 in any of the sources"...

Run 'bundle install' to install missing gems.

I am getting this error after following the latest 2.0 learn-rails tutorial while installing a project-specific gem set. The error occurs right after I enter 'rails new .'

If someone could help I'd be very thankful– I came up short during an extensive google search.

Brad

Errors with secret credentials with Rails 4.0

Hi, I copied the code from the learn-rails repo Daniel created to see if that might help solve the issues but no luck.

Below are my two errors. Let me know if you need anything else and thanks in advance!

nomethoderror_at__contacts
jesse_pinho_and_hangouts_and_nomethoderror_at__contacts

Help finding the directory I'm in

Hey folks - I'm getting this error:

nitrous io-7

However, I've created apps on heroku specifically for this project after running $ heroku apps

nitrous io-8

I thought I already was in the right directory...? How do I check for the directory that I'm supposed to be in?

Giving a 'test drive' to the app before following the book.

Hi Daniel!
I've been following along with the book and I'm very grateful for your work.
I wanted to give the app a test drive before continuing to better understand where I'm heading to, however I'm not sure how to do this (given the fact that I'm just beginning the book).

I forked your "learn-rails" and cloned it into my mac with the name "learn-rails-guide" (as "learn-rails" was already taken for following along). When tried to start the server, I got an error saying that I should run 'bundle install'.

I did so hoping that the gemset created during the following along won't get messed up; however 'bundle' wasn't able to install the 'pg' gem. And I hit a road block...

Am I taking the wrong approach for trying the finished app locally?
Will an app with a .ruby-gemset and a .ruby-version files mess up my current gemsets?

Thanks!

Support Foundation 5

Zurb Foundation 5 was released Nov 20, 2013. The name of the gem changes to "foundation-rails" and compass-rails gets dropped. Class names change and the navigation layout changes.

RVM issue

Hello,
I'm on the Get Started chapter. When I try to use the Project Specific gemset, I receive the following error when I try to confirm that I have rails installed. Any suggestions?

jeffmillar$ rvm use ruby-2.0.0@learn-rails --create
Using /Users/jeffmillar/.rvm/gems/ruby-2.0.0-p247 with gemset learn-rails
jeffmillar$ gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Users/jeffmillar/.rvm/gems/ruby-2.0.0-p247@learn-rails/bin directory.
jeffmillar$ rvm gemset list

gemsets for ruby-2.0.0-p247 (found in /Users/jeffmillar/.rvm/gems/ruby-2.0.0-p247)
(default)
global
=> learn-rails

jeffmillar$

Errors starting web server in chapter "Static Pages and Routing"

When I start the server by typing "rails server", I get the following error report in the terminal:

/Users/snowmanak/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in parse': (<unknown>): mapping values are not allowed in this context at line 6 column 15 (Psych::SyntaxError) from /Users/snowmanak/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:inparse_stream'
from /Users/snowmanak/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in parse' from /Users/snowmanak/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:inload'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@learn-rails/gems/figaro-0.7.0/lib/figaro.rb:21:in raw' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@learn-rails/gems/figaro-0.7.0/lib/figaro.rb:17:inenv'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@learn-rails/gems/figaro-0.7.0/lib/figaro/railtie.rb:7:in block in <class:Railtie>' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:36:incall'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:36:in execute_hook' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:45:inblock in run_load_hooks'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:44:in each' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:44:inrun_load_hooks'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/railties-4.0.1/lib/rails/application.rb:67:in inherited' from /Users/snowmanak/workspace/learn-rails/config/application.rb:10:inmodule:LearnRails'
from /Users/snowmanak/workspace/learn-rails/config/application.rb:9:in <top (required)>' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/railties-4.0.1/lib/rails/commands.rb:74:inrequire'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/railties-4.0.1/lib/rails/commands.rb:74:in block in <top (required)>' from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/railties-4.0.1/lib/rails/commands.rb:71:intap'
from /Users/snowmanak/.rvm/gems/ruby-2.0.0-p353@global/gems/railties-4.0.1/lib/rails/commands.rb:71:in <top (required)>' from bin/rails:4:inrequire'
from bin/rails:4:in `

'

Reference to Lowdown web application

Both versions of the book refer to the Lowdown web application for creating and organizing user stories. The link does not work and web search result does produce any familiar results. Did they change their name?

Thank you,

Gerry

Message "We recently blocked a sign-in attempt to your Google Account"

While in development I was able to login to Google Drive account and successfully write email messages to the spreadsheet. After deploying the learn-rails app to Heroku
http://remeszapp.herokuapp.com/
I get the following error messages in the Heroku logs:
2015-01-25T16:39:18.725623+00:00 app[web.1]: Processing by ContactsController#create as HTML
2015-01-25T16:39:18.724227+00:00 app[web.1]: Started POST "/contacts" for 87.207.57.86 at 2015-01-25 16:39:18 +0000
2015-01-25T16:39:18.816019+00:00 app[web.1]: Completed 500 Internal Server Error in 90ms
2015-01-25T16:39:18.725715+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"X/O43dRtqJ+A6Yqh2ysj4E4fq1bFON8eWpJD2G1RkN5+m3djTb/1ElhEY40VJaWVvcNNlQ+mSC89cr2WKayAXw==", "contact"=>{"name"=>"Kaszub", "email"=>"[email protected]", "content"=>"Whats up"}, "commit"=>"Submit"}
2015-01-25T16:39:18.726532+00:00 app[web.1]: WARNING: GoogleDriveV0.login is deprecated and will be removed in the next version. Use GoogleDriveV0.login_with_oauth instead.
2015-01-25T16:39:18.817107+00:00 app[web.1]:
2015-01-25T16:39:18.817109+00:00 app[web.1]: GoogleDriveV0::AuthenticationError (Authentication failed for [email protected]: Response code 403 for post https://www.google.com/accounts/ClientLogin: Error=BadAuthentication

I am sure that the login credentials to my google account are properly added to Heroku configuration variables. Adding subscription to Mailchip works.

Can you help me find out reason for the above errors.

  • Jarek Remesz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.