Section 5.4 Rails Tutorial - railstutorial.org

I'm tearing my hair out. I'm doing the Rails Tutorial by Hartl, and everything has been working until section 5.4.
It seems to be that I generated a new controller, then generated the integration_test user_pages, then the whole thing went haywire. I can't for the life of me work out what I've done wrong or where to start. I even tried destroying both and the same error comes out. Please help!
My Code
Jordan-Poulton:Projects academy$ cd first_app/
Jordan-Poulton:first_app academy$ subl .
Jordan-Poulton:first_app academy$ rails generate controller Users new --no-test-framework
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
create app/controllers/users_controller.rb
route get "users/new"
invoke erb
create app/views/users
create app/views/users/new.html.erb
invoke helper
create app/helpers/users_helper.rb
invoke assets
invoke coffee
identical app/assets/javascripts/users.js.coffee
invoke scss
create app/assets/stylesheets/users.css.scss
Jordan-Poulton:first_app academy$ rails generate integration_test user_pages
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
invoke rspec
create spec/requests/user_pages_spec.rb
Jordan-Poulton:first_app academy$ rails s
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
=> Booting WEBrick
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:185:in `default_controller_and_action': missing :action (ArgumentError)
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1304:in `new'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1270:in `each'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/mapper.rb:1270:in `match'
from /Users/academy/Projects/first_app/config/routes.rb:6:in `block in <top (required)>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /Users/academy/Projects/first_app/config/routes.rb:1:in `<top (required)>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/academy/Projects/first_app/config/environment.rb:5:in `<top (required)>'
from /Users/academy/Projects/first_app/config.ru:3:in `require'
from /Users/academy/Projects/first_app/config.ru:3:in `block in <main>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/academy/Projects/first_app/config.ru:in `new'
from /Users/academy/Projects/first_app/config.ru:in `<main>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/commands/server.rb:46:in `app'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
from /Users/academy/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Please check your controller. Content should be this
#app/controllers/users_controller.rb
class UsersController < ApplicationController
def new
end
end
and your routes.rb
#config/routes.rb
FirstApp::Application.routes.draw do
get "users/new"
root to: 'pages#home'
Run the following commands before rails s, just in case:
bundle install
bundle update
rake db:migrate
Sometimes a rake db:reset could help, but this will destroy and rebuild your database in your development environment.

Related

CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile. export LANG=en_US.UTF-8

[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `each_child' for #<Dir:0x00007ff3fa3555c0>
Did you mean? each_slice
/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:54:in `block in flutter_additional_ios_build_settings'
/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `each'
/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `flutter_additional_ios_build_settings'
/Users/macpro5/Downloads/oos-master/ios/Podfile:39:in `block (3 levels) in from_ruby'
/Users/macpro5/Downloads/oos-master/ios/Podfile:38:in `each'
/Users/macpro5/Downloads/oos-master/ios/Podfile:38:in `block (2 levels) in from_ruby'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:899:in `rescue in run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:896:in `run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
Error running pod install
Error launching application on iPhone 12 Pro Max.
just change your cocoapos version to 1.10.2 to solve your problem.
first uninstall your current version (whatever it is)
In my case, i downgraded from version 1.11.1
sudo gem uninstall cocoapods
Then just install the stable version (as of Nov 11, 2021)
sudo gem install cocoapods:1.10.2
and build your app again.
If still not working , delete the below from the build directory:
Podfile
Podfile.lock
Pods (directory)
and build.
It fixed it for me, twice in the last few days.
You can check your settings there with typing locale into your terminal. If there is an empty string for LANG, you need to change that.
This can be done by adding the line export LANG=en_US.UTF-8 into your ~/.bashrc or ~/.zshrc file (Depending on which terminal you are using).
After that restart your terminal, or type source ~/.zshrc.
Doublecheck if the changes are in place by checking locale.
After that you can try again flutter run in the terminal to start your flutter app

Capistrano complains there are too few arguments but it doesn't say what it's referring to

I've been bug solving all morning but I've run into something I'm unable to solve. Capistrano is throwing this message:
cap aborted!
ArgumentError: wrong number of arguments (0 for 1+)
/Users/alexander/.rvm/gems/ruby-2.2.4/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:14:in `invoke'
/Users/alexander/.rvm/gems/ruby-2.2.4/gems/capistrano-3.4.0/lib/capistrano/dsl/task_enhancements.rb:14:in `block in after'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/alexander/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/alexander/.rvm/gems/ruby-2.2.4/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/Users/alexander/.rvm/gems/ruby-2.2.4/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/Users/alexander/.rvm/gems/ruby-2.2.2/bin/cap:23:in `load'
/Users/alexander/.rvm/gems/ruby-2.2.2/bin/cap:23:in `<main>'
/Users/alexander/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
/Users/alexander/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => deploy
The deploy has failed with an error: wrong number of arguments (0 for 1+)
** Invoke deploy:failed (first_time)
** Execute deploy:failed
Any idea what it's even referring to?
You can see all of the output of running cap production deploy here.
Deploy.rb, Production.rb, and Capfile are here.
I had both Capistrano 2 and 3 installed on my machine. Uninstalling both of those gems then installing only the version I needed allowed a successful deploy!

Rails migration error with thumbs_up gem

I am using the thumbs_up gem to create a voting system. I am using PostgreSQL. When I run:
rails generate thumbs_up
I get the following error:
/usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:21:in `create_migration': wrong number of arguments (3 for 0) (ArgumentError)
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/generators/migration.rb:65:in `migration_template'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thumbs_up-0.6.7/lib/generators/thumbs_up/thumbs_up_generator.rb:22:in `create_migration'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/generators.rb:156:in `invoke'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/commands/generate.rb:11:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#firehose/gems/railties-4.0.4/lib/rails/commands.rb:48:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
How do I fix this?
This is a bug in thumbs_up.
Check this issue on github: https://github.com/bouchard/thumbs_up/issues/96
I stumbled across the same error and fixed it with the help of the link above.
Apparently all you have to do is change a file in the thumbs_up gem (you will find the location of that gem in the error itself).
In file
[path to gem]/lib/generators/thumbs_up/thumbs_up_generator.rb
replace
def create_migration
migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end
with
def create_thumbs_up_migration
migration_template 'migration.rb', File.join('db', 'migrate', 'thumbs_up_migration.rb')
end
in your Gemfile require the gem this way:
gem 'thumbs_up', git: 'https://github.com/bouchard/thumbs_up.git', ref: 'f499a7c803c0a9fdcefe4275f2f0a10ca7964508'
then run
rails generate thumbs_up
This should work. Worked for me - hope this helps....

"Could not find a JavaScript runtime." during executing the refinerycms command

I am working on Ubuntu 12.04.
I am trying to create a new website with Refinery CMS.
I read the official Getting Started guide, and executed the following command.
$ refinerycms rickrockstar
But I got the following error message:
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
rake db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
(See full trace by running task with --trace)
generate refinery:cms --fresh-installation
/home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /srv/samba/share/refinery2test/rickrockstar/config/application.rb:13:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've pasted the entire output on Gist because it was too long.
Strangely, I tried the same command some days before, and at that time everything worked fine.
Why does this happen? How can I solve it?
Maybe you could sudo apt-get install nodejs or see this post ExecJS and could not find a JavaScript runtime
To solve it I did:
Run refinerycms rickrockstar - it will fail with exception you described
Edit rickrockstar/Gemfile and uncomment *gem 'therubyracer', :platforms => :ruby* and save changes;
Run refinerycms rickrockstar again
Gemfile will have a conflict and ask if you want to override it. Answer no;
Override other files with conflicts
cd rickrockstar
rails s

Cap deploy error find_file_in_path: no such file foud

I'm using capyfony + symfony2.
cap deploy
/var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:183:in `find_file_in_load_path': no such file to load -- (LoadError)
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:171:in `load_from_file'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:89:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:93:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:89:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/configuration/loading.rb:86:in `load'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `each'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:31:in `execute!'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/lib/capistrano/cli/execute.rb:14:in `execute'
from /var/lib/gems/1.9.1/gems/capistrano-2.13.4/bin/cap:4:in `<top (required)>'
from /usr/local/bin/cap:19:in `load'
from /usr/local/bin/cap:19:in `<main>'
I got the same issue. By investigating, I tried to put:
puts Gem.find_files('symfony2.rb')
In my Capfile file, as mentioned on https://github.com/everzet/capifony/issues/190. Yet, it returns nothing. I think I miss this file. How can I get it?
Edit :
After more investigating, I finally find the solution.
I used a Capfile for Capifony 2.1.16. It seems the new version of Capifony (2.2) requires some changes in the Capfile file. With the following it should work:
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/bundles/*/*/recipes/*.rb'].each { |bundle| load(bundle) }
load Gem.find_files('capifony_symfony2.rb').last.to_s
load 'app/config/deploy'