learn-ruby-on-rails

Syntaxis error when Start Rails Server after first configuration

柔情痞子 提交于 2020-01-07 07:40:09
问题 I am trying to run rails server and I get the following error after the first configuration: => Booting WEBrick => Rails 4.2.6 application starting in development on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Exiting (erb):32:in `<main>': undefined method `ENV' for main:Object (NoMethodError) from /Users/rodpoblete/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval' from /Users/rodpoblete/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0

Bad Authentication Error Rails connecting to google drive

给你一囗甜甜゛ 提交于 2019-12-20 01:09:41
问题 I have a contacts controller which has a method to connect and save the data submitted from the form to a spreadsheet in my account on google drive (app/models/contact.rb): def update_spreadsheet connection = GoogleDrive.login(ENV["GMAIL_USERNAME"], ENV["GMAIL_PASSWORD"]) ss = connection.spreadsheet_by_title('Learn-Rails02-Example') if ss.nil? ss = connection.create_spreadsheet('Learn-Rails02-Example') end The method calls on environment variables I set up with figaro which are saved config

Issues using config/secrets.yml variable set from ENV variable on Rails 4.1.0

时光怂恿深爱的人放手 提交于 2019-12-11 01:27:03
问题 Have not played with Rails in ages so walking through the Learn Ruby on Rails tutorial which is excellent. I'm having issues with google authentication, the example code calls the config/secrets.yml variables (which are read from ENV in the shell) from the app/models/contact.rb model update_spreadsheet method below def update_spreadsheet connection = GoogleDrive.login(Rails.application.secrets.gmail_username, Rails.application.secrets.gmail_password) I have the ENV variable set via my ~/.bash

Cannot launch rails server - uninitialized constants Sprockets::Rails::VERSION::(NameError)

假如想象 提交于 2019-12-10 17:04:26
问题 I am simply trying to go through the railsapps.org Learn Ruby on Rails book online. I have everything installed and am stuck at "Launching the Web Server" in the tutorial. When I execute '$ rails server', I get the following: trick420$ rails server => Booting WEBrick => Rails 4.1.0 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) =