Closed ghost closed 9 years ago
It looks like you accidentally typed raw.githubusercontet.com
instead of raw.githubusercontent.com
in the rails new
command.
Hi Matt,
Thanks for your quick answer. Indeed, my bad, typo.... The setup works now Just to make sure I'm following the instructions correctly
I did run 'bundle exec guard' and pressed enter to run all test (I don't know if any were setup - I didn't touch anything after the setup)
I get this
bundle exec guard
00:23:12 - INFO - LiveReload is waiting for a browser to connect.
00:23:12 - INFO - Guard::Minitest 2.4.4 is running, with Minitest::Unit 5.8.0!
00:23:12 - INFO - Running: all tests
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:567:in `retrieve_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:87:in `connection'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:854:in `needs_migration?'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:397:in `load_schema_if_pending!'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:412:in `block in maintain_test_schema!'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:640:in `suppress_messages'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:417:in `method_missing'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.1/lib/active_record/migration.rb:412:in `maintain_test_schema!'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_help.rb:19:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/home/ubuntu/workspace/dictionary_main/test/test_helper.rb:3:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:114:in `each'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:113:in `each'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub test_task.rb:113:in `block in define'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:31:in `create_and_run_single_test'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/sub_test_task.rb:17:in `invoke_rake_task'
/usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/test_unit/testing.rake:8:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
-e:1:in `<main>'
Tasks: TOP => test:single
(See full trace by running task with --trace)
00:23:21 - INFO - Guard is now watching at '/home/ubuntu/workspace/dictionary_main'
Any idea what's happening here?
That error usually means that PostgreSQL is not running. I'm not familiar with Cloud 9 so I don't think I can offer much help on this one.
You might want to search to see if others have successfully run a Rails dev environment with PostgreSQL on C9 and find out how they did it. You may need to edit the database.yml
, for example.
Okay I'll investigate and see if I can find a way to make all this work! I'll reply to this message instructions if I do, in case you want to include that in your project.
Okay so I managed to use nitrious.io and didn't have to do anything to make things work. I did run bin/setup (all success)
but when I run rake test, I'm getting this:
Is that expected?
➜ blog_new git:(development) ✗ rake test
Started with run options --seed 53654
ERROR["test_rendered_page_contains_both_base_and_application_layouts", LayoutHelperTest, 2015-08-20 14:15:43 +0000]
test_rendered_page_contains_both_base_and_application_layouts#LayoutHelperTest (1440080143.82s)
ActionView::Template::Error: ActionView::Template::Error: Object must be a Date, DateTime or Time object. nil given.
app/views/layouts/base.html.erb:6:in `_app_views_layouts_base_html_erb__3111278143368264954_39544960'
app/helpers/layout_helper.rb:14:in `parent_layout'
app/views/layouts/application.html.erb:18:in `_app_views_layouts_application_html_erb__1883247592839699636_40491460'
test/integration/layout_helper_test.rb:5:in `block in <class:LayoutHelperTest>'
7/7: [===============================================================================================================================================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.07214s
7 tests, 13 assertions, 0 failures, 1 errors, 0 skips
Thanks so much for all your work on this template, and sorry for the annoyance.
Is the project committed to a git repo? There is a config/initializers/version.rb
that sets a version_time
value based on the git history, and that value is then used in the base.html.erb
template. Based on the error it looks like that value is nil.
What happens when you run this command at the command line in the root of your project?
git log -1 --format="%ad" --date=iso
Hi, you are right! If there is no git then it fails, I added a git on a fresh setup and it worked. Maybe you want to catch that error? I like to persevere on stuff, but if a user doesn't setup git right away and gets an error message on the first web page they may run away?
Awesome work anyway. Now into making livereload and better errors work.... :)
Can you do me a favor and open a new issue for the git problem? I'll try to fix it when I get the chance.
Hi,
Please go on c9.io and create a free account and free ruby workspace. I tried running your suggested code: rails new blog \ -d postgresql \ -m https://raw.githubusercontent.com/mattbrictson/rails-template/master/template.rb
but it failed
Can't provide much more help... any chance you may fix this easily?
Thanks a lot! Stephane