Rails, Can't deploy app to heroku - ruby-on-rails

I am new to rails, but got an app working great. Now I want to publish it to the web for a test. I am trying heroku, but can't get it to work.
Here is my gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use sqlite3 as the database for Active Record
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem "font-awesome-rails"
gem 'carrierwave'
gem "rmagick"
gem 'responders', '~> 2.0'
gem 'prawn'
gem 'prawn-table'
gem 'bcrypt'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
#gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
And the error when doing the git push:
The thing is when doing the git push, it cannot install pg, tilt (it is not even in my gemfile, why does it even try?), and prawn, but mainly fails on pg.
I am doing this on a windows machine.
I got successfully to this part of the heroku guide for windows: https://devcenter.heroku.com/articles/getting-started-with-jruby#deploy-the-app
Then tried deleting the rails files and folders, and copying over the ones from my app, but it fails as shown above.
Thanks in advance for your help.

Related

getting error: 'File to import not found or unreadable: foundation/functions' on Rails application

Whenever i try to access my rails app when it's running on localhost, I get the error:
File to import not found or unreadable: foundation/functions.
Load paths:
/home/oscar/RubymineProjects/myapp/app/assets/images
/home/oscar/RubymineProjects/myapp/app/assets/javascripts
/home/oscar/RubymineProjects/myapp/app/assets/stylesheets
/home/oscar/RubymineProjects/myapp/vendor/assets/javascripts
/home/oscar/RubymineProjects/myapp/vendor/assets/stylesheets
/var/lib/gems/2.1.0/gems/jquery-rails-4.1.0/vendor/assets/javascripts
/var/lib/gems/2.1.0/gems/coffee-rails-4.1.1/lib/assets/javascripts
/var/lib/gems/2.1.0/gems/foundation-rails-6.1.2.0/vendor/assets/js
/var/lib/gems/2.1.0/gems/foundation-rails-6.1.2.0/vendor/assets/scss
/var/lib/gems/2.1.0/gems/cocoon-1.2.7/app/assets/javascripts
I have tried fixing this using every method I could find in similar questions, but to no avail. Here is my Gemfile:
source 'https://rubygems.org'
gem 'foundation_rails_helper'
gem 'cocoon'
gem 'devise'
gem 'foundation-rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0.4'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
## Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'remove_turbolinks'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'better_errors'
end
Any advice or suggestions would be appreciated.

Rails Bootstrap V4 alpha 3 gem install fail

I get the following error when I run bundle install do I just need to install x86-mingw32 or? Any help would be really appreciated also would it be better that I just use the CDN version?
Could not find gem 'bootstrap (>= 4.0.0.alpha2, ~> 4.0) x86-mingw32
the gem sources listed in your Gemfile or available on this machine
Here is my Gem file
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.1'
#Bootstrap 4 alpha 3 gem for amazing sexiness
gem 'bootstrap', '~> 4.0', '>= 4.0.0.alpha2'
#coffee script for well cofee script stuff
gem 'coffee-script-source', '1.8.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Just wondering, why do you need two gem specifiers? I got the same error running it your way but then I retried using one specifier:
gem 'bootstrap', '>= 4.0.0.alpha2'
And it worked for me.
Note: You can check releases for this gem here

How is this syntax causing an error with parsing my gemfile?

I am following http://installfest.railsbridge.org/ and I'm to edit my Gemfile and change
gem 'sqlite3'
to
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
I did that and now it's telling me to type
push to heroku master
and I'm getting an error message saying:
Gemfile syntax error on line 7: syntax error, unexpected keyword_do_block
on line 9: syntax error, unexpected keyword_end, expecting end-of-input
Push rejected, failed to compile Ruby app
I'm on Windows and I JUST installed everything today so I have the latest versions of everything. Does anybody know why this is happening?
Here's the Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

rspec using old files when rerunning tests

This is my first project in Rails 4, I'm using 4.2
I'm finding that rspec is not reloading my spec files each time it runs, so tests that I've fixed continue to fail with the old error message.
I'm guessing this has something to do with spring but I can't seem to find information on how to configure paths it should reload.
I'm launching rspec using bin/rspec, and here's my Gemfile if that's of use.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Angular CSRF handling
gem 'angular_rails_csrf'
gem 'pg'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
#gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
gem 'sass', '3.2.19'
group :test, :development do
gem "factory_girl_rails", "~> 4.0"
gem "capybara"
gem "database_cleaner"
gem "selenium-webdriver"
gem "teaspoon-jasmine"
gem 'teaspoon'
gem 'phantomjs'
gem 'guard-teaspoon'
gem 'spring-commands-teaspoon'
gem 'rspec-rails'
gem 'spring-commands-rspec'
gem 'guard-rspec'
gem 'rb-readline'
gem 'rb-fsevent' if `uname` =~ /Darwin/
end
gem 'bootstrap-sass', '~> 3.1.1'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bson_ext', '~> 1.8.6'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '1.3.6'
end
# Preload angular templates
gem 'angular-rails-templates'

Trouble Installing Bootstrap on Rails

I am trying to install Bootstrap on Rails but can't seem to get it installed. I have ran bundle install , bundle update and rails server but just can't seem to get it to work.
Here is the error code:
File to import not found or unreadable: bootstrap.
Load paths:
c:/Users/teddynuts/Desktop/pinteresting/app/assets/images
c:/Users/teddynuts/Desktop/pinteresting/app/assets/javascripts
c:/Users/teddynuts/Desktop/pinteresting/app/assets/stylesheets
c:/Users/teddynuts/Desktop/pinteresting/vendor/assets/javascripts
c:/Users/teddynuts/Desktop/pinteresting/vendor/assets/stylesheets
c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/turbolinks-2.2.2/lib/assets/javascripts c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/jquery-rails-3.1.0/vendor/assets/javascripts
c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/coffee-rails-4.0.1/lib/assets/javascripts
(in c:/Users/teddynuts/Desktop/pinteresting/app/assets/stylesheets/bootstrap_and_customization.css.scss:1)
My CSS file titled bootstrap_and_customization.css.scss code is:
#import "bootstrap";
My Gem file code is:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0'
gem 'bootstrap-sass',
group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
You need to assign something to your "group". What goes into group :doc ?
I see that you are taking the One Month Rails Tutorial, so the gemfile for the Lesson (Until bootstrap) should be this:
source 'https://rubygems.org'
gem 'rails', '4.1.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass', '~> 3.1.1'
# Gems for Local Development
group :development, :test do
gem 'sqlite3'
end
# Gems for Heroku
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
Official Sass port of Bootstrap
Sometimes when you are stuck just give the Official Repo a look.
The problem is here:
gem 'bootstrap-sass',
group: :doc
It may not be obvious, but it's one statement. In fact, it's interpreted like this:
gem 'bootstrap-sass', { :group => :doc }
...and therefore the specified gem is only available during docs generation. And the solution for this exact issue is to replace the above with:
gem 'bootstrap-sass'
However, since you're on Windows (if it's x64, which is likely), you may run into other issues, like this one.
Try bootstrap-sass-rails instead. It works in the asset pipeline. https://github.com/yabawock/bootstrap-sass-rails

Resources