railstutorial.org

Rails broken - bundle not working - ovirt-engine-sdk - ERROR: Failed to build gem native extension. Cloud9 AWS

女生的网名这么多〃 提交于 2020-01-12 06:15:27
问题 I am working through the Ruby on Rails Tutorial (Rails5) by Michael Hartl in the AWS Cloud9 environment. I'm finishing chapter 11 now. (new to programming as well) It appears I have broken something related to the Rails (or Ruby) system. I am no longer able to start the Rails server, test or console. The error message I get usually starts with this, which I have not had any luck finding much information on here or via Google. ovirt-engine-sdk -v '4.2.3' /usr/local/rvm/gems/ruby-2.4.1/gems

Rails broken - bundle not working - ovirt-engine-sdk - ERROR: Failed to build gem native extension. Cloud9 AWS

落花浮王杯 提交于 2020-01-12 06:15:22
问题 I am working through the Ruby on Rails Tutorial (Rails5) by Michael Hartl in the AWS Cloud9 environment. I'm finishing chapter 11 now. (new to programming as well) It appears I have broken something related to the Rails (or Ruby) system. I am no longer able to start the Rails server, test or console. The error message I get usually starts with this, which I have not had any luck finding much information on here or via Google. ovirt-engine-sdk -v '4.2.3' /usr/local/rvm/gems/ruby-2.4.1/gems

Rails Tutorial — 9.3.3 Current_User

喜欢而已 提交于 2020-01-10 03:21:06
问题 So I'm following the Rails Tutorial, and I've gotten to the portion where we want to sign a user in with a sign_in SessionHelper. Question 1 : module SessionsHelper def sign_in(user) cookies.permanent.signed[:remember_token] = [user.id, user.salt] current_user = user end def current_user=(user) #set current_user @current_user = user end def current_user #get current_user @current_user end What I'm having difficulty with is the part that reads: The problem is that it utterly fails to solve our

Why does carrierwave cause the NameError: uninitialized constant Micropost::PictureUploader error?

为君一笑 提交于 2020-01-03 19:17:18
问题 In the Hartl Rails tutorial chapter 13.4.1 Basic image upload we add the carrierwave gem for image uploads. But, I kept getting this error in my tests after generating the uploader and adding the migration to the Microposts model: NameError: uninitialized constant Micropost::PictureUploader After googling around I was able to fix this by adding this to my environments.rb : require 'carrierwave/orm/activerecord' But I feel like I'm doing something wrong because Hartl does not do this and he

uninitialized constant ApplicationRecord

孤者浪人 提交于 2020-01-01 08:06:10
问题 I am working on the rails tutorial book online and I am getting the following error message when I go to http://localhost:3000/ "uninitialized constant ApplicationRecord" and it gives me the following code highlighting the first line. class User < ApplicationRecord attr_accessor :remember_token before_save { self.email = email.downcase } validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, length: {

ruby on rails tutorial section 3.2 rspec testing error

故事扮演 提交于 2020-01-01 06:12:03
问题 recently started the RoRTute by Michael Hartl, getting stuck trying my first rspec test in section 3.2, at this point the test is meant to fail but all i get are errors which I'm having a hard time interpreting. I've had a look around but not getting much luck finding a similar error and/or solution. I am brand new to programming and ruby/rails. Any help would be greatly appreciated, thank you! terminal error output Macintosh:sample_app rails$ bundle exec rspec spec/requests/static_pages_spec

ruby on rails tutorial section 3.2 rspec testing error

坚强是说给别人听的谎言 提交于 2020-01-01 06:11:20
问题 recently started the RoRTute by Michael Hartl, getting stuck trying my first rspec test in section 3.2, at this point the test is meant to fail but all i get are errors which I'm having a hard time interpreting. I've had a look around but not getting much luck finding a similar error and/or solution. I am brand new to programming and ruby/rails. Any help would be greatly appreciated, thank you! terminal error output Macintosh:sample_app rails$ bundle exec rspec spec/requests/static_pages_spec

Add a JavaScript display to the Home page to count down from 140 characters. (Rails Tutorial, 2nd Ed, Chapter 10, Exercise 7)

[亡魂溺海] 提交于 2019-12-31 13:13:34
问题 This exercise was a bit tricky. Figured I'd post my solution to see if anyone did it differently or if there's anyone who knows a better way. I'm not sure on best practices for using the Asset Pipline .. for example, the correct order to put things in the application.js manifest file, or when to put things in lib versus app. I just put the following in lib to try getting it to work. From Michael Hartl's Rails Tutorial 2nd ed Chapter 10, Exercise 7: (challenging) Add a JavaScript display to

How to grant permissions to AWS user for Hartl's rails tutorial

情到浓时终转凉″ 提交于 2019-12-30 01:29:07
问题 I don't know how (or where also) to grant read and write permission to the user from AWS so users can post pictures on sample_app in production enviroment. This is final task in 11th chapter, it isn't covered by tutorial and I can't find solution anywhere. This is carrier_wave.rb file: if Rails.env.production? CarrierWave.configure do |config| config.fog_credentials = { # Configuration for Amazon S3 :provider => 'AWS', :aws_access_key_id => ENV['lalala'], :aws_secret_access_key => ENV[

User Signup Test failing in M.Hartl's Rails Tutorial

帅比萌擦擦* 提交于 2019-12-25 00:42:50
问题 I've been following M. Hartl's Rails Tutorial and I've encountered a problem. As I moved from chapter 10 all by code was working and my test suite was passing. In chapter 11, all I have done so far is to create a new branch. None of my files have been altered. Yet somehow, my test suite is now failing. Even more strange, is that it doesn't fail 100% of the time. Sometimes it passes, but most of the time it fails (if I run it again and again without changing any code). The relevant code and