try using the bin/bundle install command - ruby-on-rails

This is my gem file
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3’, group: [:development, :test]
# gems required by Heroku
gem ‘pg’, group: :production
gem ‘rails_12factor’, group: :production
# 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'
# 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'
end
This is the error i get when trying to use the bin/bundle install command
LJ$ bin/bundle install --without production
[!] There was an error parsing `Gemfile`: syntax error, unexpected tIDENTIFIER, expecting end-of-input - gem 'sass-rails', ‘~> 5.0’
^. Bundler cannot continue.
# from /Users/LJ/code/blog/Gemfile:12
# -------------------------------------------
# # Use SCSS for stylesheets
> gem 'sass-rails', ‘~> 5.0’
# # Use Uglifier as compressor for JavaScript assets
# -------------------------------------------
**I can't figure out what the problem is. I am going along with the Rails Crash Course book if that helps.

An example of the invalid quote characters is:
gem 'sqlite3’
The second ' is an invalid single quote. Notice how it slightly curves in your sample code.
These types of errors usually show up when you edit the text in a text editor like TextEdit. Try fixing the single quotes using a different text editor. Try using something like TextWrangler, SublimeText, or just nano.

Related

Generate is not generating the codes

I'm trying to give a generate any, and it will not, this error appears, and sometimes nothing appears, it keeps running forever, and nothing appears. What is going on? I'm new to this area.
root#ubuntu:~/Projeto/Projeto_testes/teste_projeto_generator# rails g scaffold User name email
/usr/lib/ruby/vendor_ruby/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
root#ubuntu:~/Projeto/Projeto_testes/teste_projeto_generator#
I did not solve it permanently, but I found a solution to circumvent the error.
When I give a new rails, it generates the gem file, there will be specified the rails version, I just change the generated gemfile, the one I "created":
source 'https://rubygems.org'
gem 'openssl', '2.0.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', github: 'rails/rails', branch: '4-2-stable'
# 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.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'rails-i18n', '~> 4.0.0'
# 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'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
I could not use the rbenv nor rvm to upgrade my rails, so I do this "adjustment".

Deploy Rails app to Heroku detect app matching no buildpack

This might be a duplicate however, I could not fix it from those answers so any help will be appreciated.
Error
Failed to detect app matching no buildpack
After creating the Heroku app I set my buildpack (same error comes with heroku/ruby buildpack)
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby.git
Gemfile and Gemfile.lock are in the root folder.
Added ruby version and rails_12factor gem to Gem file.
PostgreSQL set to production.
ruby "2.3.0"
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
group :development, :test do
gem 'sqlite3'
end
group :production, :test do
gem 'pg'
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
gem 'kaminari'
gem 'soundcloud'
gem 'redis'
gem 'yt', '~> 0.28.0'
# 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'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'rails_12factor', group: :production
.gitignore
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
*.DS_Store

Rails 4 Heroku Deployment The Page Doesn't Exists

I have a basic rails app contains nothing but Welcome controller and Index action.Which both empty.I have defined a root route to it.And deployed to heroku.Bu i get "The page you were looking for doesn't exist." this error message.My url is "https://murmuring-island-27368.herokuapp. c o m/".(Please delete the spaces from c o m ).Btw i tried running production env on local but it says "Internal Server Error
Missing secret_token and secret_key_base for 'production' environment, set these values in config/secrets.yml".So what should i do?
This is the gem file.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# 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'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
Generate new secret key, Try
rake secret

Social_stream gem migration error

I have been trying to install the social_stream engine in rails 4.2.3. I'm following the guide from their home page [(http://social-stream.dit.upm.es/started/#rails)][1] Everything works until I try to migrate.
I get the following error
undefined method `database_authenticatable' for #`<ActiveRecord::ConnectionAdapters::TableDefinition`
I have tried installing this as a Mountable Engines as shown in a rails cast. That also doesn't work.
this is how my gem file looks
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# 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.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
gem 'social_stream'
# 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'
end
I'm using cloud ide. cloud9.io. Please help me resolve this issue as I really want to try this engine out. Please let me know if there are any resources on how to install and get it working. Thank you in advance.

Activemessaging caused infinite loop in my Rails app

In my rails app, activemessaing caused an infinite loop, e.g. when I run bundle install, an error message is given:
"Your Gemfile requires gems that depend on each other, creating an infinite loop. Please remove gem 'activemessaging' and try again."
Any ideas?
Gemfile
source 'https://rubygems.org'
#gem 'dotenv-rails', :groups => [:development, :test]
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# 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.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', 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
gem 'bootstrap-sass', '3.2.0.0'
gem 'rails_config'
gem 'nokogiri-pretty'
gem 'dotenv-rails'
gem 'devise'
gem 'devise_ldap_authenticatable'
gem "activemessaging"
gem 'stomp'
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'
end
gem 'daemons'
As the message suggests, the problem is caused by the infinite loop dependency, e.g. activemessaging depends on itself. Check the gem spec in activemessaging to see if there is a self dependency defined.
I managed to get it fixed.
Just refer activemessaging to my forked version:
gem "activemessaging", :git => "https://github.com/digital-york/activemessaging.git"
The changes I've made is just to comment out self dependencies in the gem spec.

Resources