After I installed gem grape-jbuilder
and run bundle exec rails s it showed this message
bin/rails:6: warning: already initialized constant APP_PATH
/Users/xxx/xxx/bin/rails:6: warning: previous definition of APP_PATH was
here
Usage: rails COMMAND [ARGS]
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
new application called MyApp in "./my_app"
In addition to those, there are:
destroy Undo code generated with "generate" (short-cut alias: "d")
plugin new Generates skeleton for developing a Rails plugin
runner Run a piece of code in the application environment (short-cut alias: "r")
All commands can be run with -h (or --help) for more information.
And when I run bundle exec rake rails:update:bin
It show the error message below
rake aborted!
LoadError: cannot load such file -- hashie/hash
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in require'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:inblock in require'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in load_dependency'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:inrequire'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/grape-jbuilder-0.2.0/lib/grape/jbuilder.rb:2:in <top (required)>'
/Users/xxx/xxx/config/application.rb:7:in'
/Users/xxx/xxx/Rakefile:4:in require'
/Users/xxx/xxx/Rakefile:4:in'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in <top (required)>'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:inload'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:in <main>'
LoadError: cannot load such file -- grape-jbuilder
/Users/xxx/xxx/config/application.rb:7:in'
/Users/xxx/xxx/Rakefile:4:in require'
/Users/xxx/xxx/Rakefile:4:in'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in <top (required)>'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:inload'
/Users/jiaping/.rbenv/versions/2.3.1/bin/bundle:23:in `'
(See full trace by running task with --trace)
Gemfile
gem 'rails', '4.2.4'
gem 'rack-contrib'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'therubyracer'
gem 'rb-readline'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'bootstrap-sass'
gem 'font-awesome-rails'
gem 'react-rails'
gem 'coffee-rails', '~> 4.1.0'
gem 'uglifier', '>= 1.3.0'
gem 'sass-rails'
gem 'momentjs-rails'
gem 'bootstrap3-datetimepicker-rails'
gem 'jquery-payment-rails', git: 'https://github.com/thoughtbot/jquery-payment-rails.git'
gem 'page_title_helper'
gem 'sprockets-es6', require: 'sprockets/es6'
gem 'jbuilder', '~> 2.0'
gem 'sorcery'
gem 'oauth2', '~> 1.3.0'
gem 'bcrypt'
gem 'dotenv-rails'
gem 'config', '~> 1.0.0'
gem 'enum_help'
gem 'mysql2', '~> 0.3.18'
gem 'squeel'
gem 'seed-fu'
gem 'carrierwave'
gem 'carrierwave-data-uri'
gem 'carrierwave-aws'
gem 'rmagick'
gem 'acts_as_list'
gem 'kaminari'
gem 'ransack'
gem 'rails-jquery-autocomplete'
gem 'gretel'
gem 'email_validator'
gem 'icalendar'
gem 'bootstrap_form'
gem 'paranoia', '~> 2.0'
gem 'unicorn'
gem 'unicorn-rails'
gem 'unicorn-worker-killer'
gem 'google-analytics-rails'
gem 'meta-tags'
gem 'web-console', '~> 2.0', group: :development
gem 'adminlte2-rails'
gem 'geocoder'
gem 'validates_timeliness', '~> 4.0'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'whenever', require: false
gem 'holiday_jp'
gem 'exception_notification', github: 'smartinez87/exception_notification'
gem 'slack-notifier'
gem 'grape'
gem 'grape-jbuilder'
group :staging do
gem 'letter_opener_web'
end
group :development, :test do
gem 'letter_opener'
gem 'spring'
gem 'spring-commands-rspec'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'simplecov', require: false
gem 'rubocop'
gem 'byebug'
gem 'better_errors'
gem 'pry'
gem 'pry-byebug'
gem 'pry-doc'
gem 'pry-rails'
gem 'pry-stack_explorer'
gem 'quiet_assets'
gem 'awesome_print'
gem 'annotate'
gem 'migration_comments'
gem 'capistrano', '~> 3.4.0'
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'capistrano-bundler'
gem 'capistrano3-unicorn'
gem 'rails-admin-scaffold'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'faker'
gem 'fuubar'
gem 'launchy'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'timecop'
end
How can I solve this problem?
From here:
Actually it's spring which cause this issue. Try to comment it in the
Gemfile, then bundle install and restart the server ; shutting it
down, the warning is not present anymore.
Related
R is running okay in development on my Rails 4.2.6 app, but I can't get it to run in production on Heroku with the RinRuby gem (2.0.3). Heroku rejects an attempted push with the following errors (relevant parts of log):
-----> Installing node-v6.10.0-linux-x64
-----> Detecting rake tasks
sh: 2: Syntax error: Unterminated quoted string
sh: 2: Syntax error: Unterminated quoted string
/app/tmp/buildpacks/ f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/lib/language_pack/helpers/rake_runner.rb:102:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'rinruby'.
Gem Load Error is: No such file or directory - R
ruby_compile:15:in `<main>'
! Push rejected, failed to compile Ruby app.
! Push failed
I didn't have problems deploying to Heroku before installing RinRuby. I can successfully run
bundle exec rake -P command
against the app. I also tried placing
config.assets.compile =true
in the production environment, but that didn't solve the issue.
Don't know what's going on with the syntax errors; stumped on the RinRuby load error. To deploy R in production, I have the following files in the root directory:
.buildpacks:
http://github.com/virtualstaticvoid/heroku-buildpack-r.git#cedar-14-chroot
https://github.com/heroku/heroku-buildpack-ruby.git
init.r:
install.packages("ggplot2", dependencies = TRUE)
While researching, I found a similar but unanswered post: Install error of Rinruby on Heroku
What I'm I missing? How do I fix? More detail ... here's the gem file:
source 'https://rubygems.org'
ruby "2.2.4"
gem 'rails', '4.2.6'
gem 'bootstrap-sass', '~> 3.2.0.0'
gem "font-awesome-rails"
gem 'bcrypt', '~> 3.1.7'
gem 'cancancan', '~> 1.10'
gem 'devise'
gem 'rolify'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-tablesorter'
gem 'momentjs-rails', '>= 2.8.1'
gem 'bootstrap3-datetimepicker-rails', '~> 4.7.14'
gem 'turbolinks'
gem 'jquery-turbolinks', '~> 0.2.1'
gem 'jbuilder', '~> 2.0'
gem 'jc-validates_timeliness'
gem 'validates_overlap'
gem 'time_difference'
gem 'simple_form'
gem "paperclip", "~> 5.1.0"
gem 'aws-sdk', '~> 2' # Amazon S3 cloud storage
gem 'chart-js-rails', '~> 0.0.9'
gem 'by_star', :git => "git://github.com/radar/by_star"
gem 'ransack'
gem 'kaminari'
gem 'private_pub'
gem 'thin' # serves Faye to handle publishing/subscribing asynchronously
gem 'twilio-ruby', '~> 4.11.1'
gem 'newrelic_rpm'
gem 'rinruby', '~> 2.0', '>= 2.0.3'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :development do
gem 'spring'
gem 'better_errors'
gem 'binding_of_caller'
gem 'figaro'
gem 'guard-rspec', require: false
gem 'seed_dump'
gem 'rails-erd'
gem 'brakeman', require: false
gem 'rubocop', require: false
gem 'rails_best_practices', require:false
gem "letter_opener"
end
group :development, :test do
gem 'pg'
gem 'rspec-rails'
gem 'factory_girl_rails'
end
group :test do
gem 'capybara'
gem 'capybara-email'
gem 'email_spec'
gem 'shoulda-matchers'
gem 'faker'
gem 'database_cleaner'
gem 'launchy'
gem 'rspec-activemodel-mocks'
gem 'poltergeist'
gem 'pry-rails'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'unicorn', '~> 4.8.3'
end
I successfully installed R on Heroku for my Rails app. In an effort to help someone else who may need this information, here are the steps I took to solve the problem:
Uninstalled the RinRuby gem, and installed rootapp-rinruby (https://rubygems.org/gems/rootapp-rinruby), a more recent fork of the RinRuby gem.
Modifed the int.r file:
my_packages = c("ggplot2")
install_if_missing = function(p) {
if (p %in% rownames(installed.packages()) == FALSE) {
install.packages(p, dependencies = TRUE)
}
else {
cat(paste("Skipping already installed package:", p, "\n"))
}
}
invisible(sapply(my_packages, install_if_missing))
Created a file called .r-version and put it in root directory with the following content:
3.4.0
Added this R buildpack (http://github.com/virtualstaticvoid/heroku-buildpack-r.git#cedar-14-chroot) to Heroku
Now when I push, the Heroku log reports....
R 3.4.0 successfully installed (with init)
I hope this information helps someone. Good luck!
For improved visibility, placing my comment as an answer:
In your Gemfile, replace:
gem 'rinruby'
with
gem 'rootapp-rinruby'
Need help.
When I try to make
user#X220:~/rails_projects/sample_app$ heroku run rake db:migrate
There is a mistake:
Running rake db:migrate on limitless-fjord-69900.... up, run.2816
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded.
Add gem 'pg' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/connection_specification.rb:177:in rescue in spec'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/connection_specification.rb:174:inspec'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:50:in establish_connection'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/railtie.rb:120:inblock (2 levels) in '
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:38:in instance_eval'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:38:inexecute_hook'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:45:in block in run_load_hooks'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:44:ineach'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:44:in run_load_hooks'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/base.rb:315:in'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/base.rb:26:in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.6/lib/active_record/tasks/mysql_database_tasks.rb:8:in'
.
.
.
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
My Gemfile is:
'source 'https://rubygems.org'
ruby '2.2.0'
gem 'activerecord', '~> 4.2', '>= 4.2.6'
gem 'rails', '4.2.6'
group :development, :test do
gem 'byebug'
gem 'sqlite3', '~> 1.3', '>= 1.3.11'
gem 'rspec-rails', '~> 2.8'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
end
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
group :doc do
gem 'sdoc', '~> 0.4.0', require: false
end
gem 'unicorn'
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
gem 'rails_12factor'
gem 'pg'
end
What's wrong?
Remove or comment gem 'sqlite3' from your Gemfile even if it in development group.
I don't know why but Heroku doesn't run your application when it contains sqlite gem outside production.
If you are use SQLite in development, you have to comment gem 'sqlite' every time when deploying to Heroku and uncomment after deploying.Better way will be use Postgres in development.
As suggested before, this could have to do with your sqlite gem.
If you still want to use sqlite you can set to ignore that group. From Heroku docs:
To specify groups of gems to not to be installed, you can use the BUNDLE_WITHOUT config var.
$ heroku config:set BUNDLE_WITHOUT="development:test"
I tried to deploy the ruby on rails project from a github folder. However, I got such an error when I run cap production deploy
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
'require': cannot load such file -- capistrano/cli (LoadError) from /home/deploy/.rbenv/
versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /usr/bin/cap:3:in '<main>'
I have deploy.rb starting with:
# config valid only for Capistrano 3.1
lock '3.1.0'
And I installed Capistrano v.3.1 with the following command-line:
gem install capistrano -v 3.1.0
Anybody has ideas why I still got an error?
Attached Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.1.0'
# Frontend
gem 'simple_form'
gem 'nested_form', github: 'ryanb/nested_form'
gem 'turbolinks'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'kaminari'
# Javascript
gem 'gon'
gem 'angularjs-rails'
gem 'selectize-rails'
gem 'js-routes'
# Backend
gem 'pg'
gem 'mongoid', github: 'mongoid/mongoid'
gem 'mongoid_geospatial'
gem "active_model_serializers"
gem 'devise'
gem 'state_machine'
gem "rolify"
gem "pundit"
gem 'enumerize'
gem 'simple-rss'
gem 'tweetstream'
gem 'swagger-docs', path: "vendor/gems/swagger-docs-0.1.5"
gem 'wkhtmltopdf-binary'
gem 'wicked_pdf'
gem 'paper_trail', '~> 3.0.3'
# Temporary
gem 'faker'
gem 'factory_girl_rails'
# Asset gems
gem 'haml-rails'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'sass-rails', '~> 4.0.3'
gem 'compass-rails'
group :development do
gem 'spring' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'switch_user'
gem 'better_errors'
gem 'binding_of_caller'
gem 'sextant'
gem 'guard-livereload', require: false
gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-rbenv', github: "capistrano/rbenv"
end
group :test do
gem 'rspec-rails'
gem 'spring-commands-rspec'
gem 'guard-rspec'
gem 'fuubar'
gem 'capybara'
gem 'capybara-webkit'
gem 'capybara-email'
gem 'capybara-screenshot'
gem 'database_cleaner'
end
group :test, :darwin do
gem 'rb-fsevent'# if `uname` =~ /Darwin/
end
group :development, :test do
gem 'pry-rails'
gem 'pry-remote'
end
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
Thanks!
I have almost read every question and doc about deployment to heroku, and this is not my first time, but now in a very weird scnario when I deploy I can't create the database:
Running `rake db:create --trace` attached to terminal... up, run.8982
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create
FATAL: permission denied for database "postgres"
DETAIL: User does not have CONNECT privilege.
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-4.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-4.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `new'
.
.
.
.
Couldn't create database for {"adapter"=>"postgresql", "host"=>"ec2-23-23-244-144.compute-1.amazonaws.com", "encoding"=>"unicode", "database"=>"d80e387p61nnl1", "pool"=>5, "template"=>"template0", "username"=>"******", "password"=>"********", "port"=>5432}
It's not this:
FactoryGirl screws up rake db:migrate process
I took out everything related to Factory girl pretty much, everything in the spec file.
Not this either:
Rails 4.0.1 on Heroku, can't create database
this is my gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '4.1.2'
#Assets
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'jquery-turbolinks'
gem 'turbolinks'
gem "autoprefixer-rails"
#jQuery
gem 'magnific-popup-rails'
gem 'ckeditor'
gem 'gmaps4rails'
gem "select2-rails"
gem 'chosen-rails'
gem 'jquery-tokeninput-rails'
gem 'jquery-timepicker-rails'
gem 'easy_as_pie'
gem 'modernizr-rails'
gem "font-awesome-rails"
gem 'jquery-slimscroll-rails'
gem 'jquery-placeholder-rails'
gem 'autosize-rails'
gem 'newrelic_rpm'
#frontend
gem 'rails_12factor', group: :production
gem 'friendly_id', '~> 5.0.0' # Note: You MUST use 5.0.0 or greater for Rails 4.0+
gem 'rack-cors', :require => 'rack/cors'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'bootstrap-sass'
gem 'devise'
gem 'high_voltage'
gem 'thin'
gem 'lodash-rails'
#Database
gem 'ransack'
gem 'pg'
gem 'pg_search'
gem 'simple_form'
# gem 'ng-rails-csrf'
gem 'wiselinks'
# Development Only
group :development do
gem 'binding_of_caller', :platforms=>[:mri_19]
gem 'rails_layout'
gem 'meta_request'
gem 'better_errors'
gem 'hirb' #use Hirb.enable to enable it / text to Column
gem 'awesome_print', :require => 'ap'
gem 'railroady' #run this command: rake diagram:all
gem "bullet" # it always works unless you remove the initilzer
gem "reek" # run this : reek .
gem 'brakeman', :require => false # run this : brakeman [appPath] -o output_file
gem 'traceroute' # to check unUsed and Unreachable routes > rake traceroute
gem 'quiet_assets' #takes away the Asset messages in the Log
gem 'annotate', ">=2.6.0"
gem "letter_opener", :group => :development
gem 'rails_apps_pages'
end
group :development, :test do
gem 'rspec-rails'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'launchy'
gem 'selenium-webdriver'
end
gem 'ffaker'
gem 'populator'
gem 'activeadmin', github: 'gregbell/active_admin'
# gem "meta_search", '>= 1.1.0.pre'
#rails Legacy Gems
gem 'protected_attributes'
gem 'rails-observers'
gem 'actionpack-page_caching'
gem 'actionpack-action_caching'
#Images:
gem 'carrierwave'
gem 'rmagick', :require => false
gem 'kaminari'
# gem "bower-rails", "~> 0.8.3"
# gem 'react-rails', '~> 0.10.0.0'
# gem 'react-rails', '~> 1.0.0.pre', github: 'reactjs/react-rails'
# gem "therubyracer", :platforms => :ruby
# gem "therubyrhino", :platforms => :jruby
gem 'activerecord-reputation-system'
gem 'acts-as-taggable-on'
gem 'markable'
gem 'country_select', github: 'stefanpenner/country_select'
gem 'rails4-autocomplete'
# gem 'linkedin' hasie 3.3.0 error
#messaging
gem 'mailboxer'
IN my Heroku Logs, this what I found:
Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
2014-09-07T17:20:38.089695+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-09-07T17:20:38.089697+00:00 app[web.1]: Exiting
2014-09-07T17:20:38.357403+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `require': No such file to load -- mini_magick (LoadError)
2014-09-07T17:20:38.357406+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `block in require'
any help would be veryyy very much appreciated.
There are few lessons to be learnt from this problem that I came across, but first let's answer and then explain what was going on.
Short answer:
Despite removing the tests that was considered to cause the rake to break, there were other things left out that needed to be removed and it was causing problems:
1- In the application.rbthis was happening:
config.generators do |g|
g.test_framework :rspec,
fixtures: true,
view_specs: false,
helper_specs: false,
routing_specs: false,
controller_specs: false,
request_specs: false
g.fixture_replacement :factory_girl, dir: "spec/factories"
end
2- In seed.rb file this was happening:
# user = CreateAdminService.new.call
# puts 'CREATED ADMIN USER: ' << user.email
The lesson:
1- Don't use auto app generators. In my case I was using #RailsComposer.
2- Bower on Rails is a bad decision, it can turn a very simple app to a crazy amazin jungle
I am going through the railstutorial.org book.
I am receiving this error:
$ bundle exec guard init rspec
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard/interactor.rb:1:in
require': cannot load such file -- pry (LoadError)
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard/inter
actor.rb:1:in'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard/dsl.r
b:2:in require'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard/dsl.r
b:2:in'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard.rb:6:
in require'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/lib/guard.rb:6:
in'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/bin/guard:3:in
require'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-2.0.3/bin/guard:3:in
'
from c:/Ruby200-x64/bin/guard:23:in load'
from c:/Ruby200-x64/bin/guard:23:in'
My gem file is:
1. source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'rspec-rails', '2.13.1'
gem 'guard-rspec', '2.0.0'
gem 'guard', '2.0.3'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'rb-notifu', '0.0.4'
gem 'win32console', '1.3.2'
gem 'wdm', '0.1.0'
end
# Use SCSS for stylesheets
gem 'sass-rails', '4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'
# 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', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
Am I missing something? Thanks for any help!
Looks like guard requires pry be installed.
gem install pry
Explicitly add pry or similar to your Gemfile. I use pry-nav which will automatically bundle pry when bundle install is run.
# Gemfile
gem 'pry-nav', group: [:development, :test]
Cite:
http://pryrepl.org/
https://github.com/nixme/pry-nav
https://github.com/nixme/pry-debugger
https://github.com/rweng/pry-rails