starterkits/rails4-starterkit

gemfile requires ruby 2.1.0

Closed this issue · 7 comments

Since I am using windows 8 platform, there is no rubyinstaller support for ruby 2.1.0. Similarly no rvm for windows. I don't know other options to upgrade to 2.1. Please show me the workaround. currently I have ruby 2.0.0 installed.

You should be able to change line two of the Gemfile to be ruby '2.1.0' before running bundle install, assuming that the rest of the dependencies are compatible with that version of Ruby.

I encountered another problem while running Bundle install

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/robus/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/robus/.rvm/rubies/ruby-2.1.0/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in /home/robus/.rvm/gems/ruby-2.1.0/gems/pg-0.17.1 for inspection.
Results logged to /home/robus/.rvm/gems/ruby-2.1.0/extensions/x86-linux/2.1.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that gem install pg -v '0.17.1' succeeds before bundling.

You need to have PostgreSQL installed and configured on your local machine since the pg gem just gives you an interface to PostgreSQL's native binaries. If you're on Mac, you can use Homebrew to install PostgreSQL, like so: brew install postgresql

I have postgreSQL installed and configured but still problem persist

robus@lucy:~/starterkit$ rake db:migrate --trace

SafeYAML Warning


You appear to have an outdated version of libyaml (0.1.4) installed on your system.

Prior to 0.1.6, libyaml is vulnerable to a heap overflow exploit from malicious YAML payloads.

For more info, see:
https://www.ruby-lang.org/en/news/2014/03/29/heap-overflow-in-yaml-uri-escape-parsing-cve-2014-2525/

The easiest thing to do right now is probably to update Psych to the latest version and enable
the 'bundled-libyaml' option, which will install a vendored libyaml with the vulnerability patched:

gem install psych -- --enable-bundled-libyaml

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
2014-04-16T19:47:55Z 13789 TID-19cssc INFO: Sidekiq client with redis options {:url=>"redis://localhost:6379/0", :namespace=>"workers", :size=>1}
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
rake aborted!
PG::ConnectionBad: FATAL: Peer authentication failed for user "postgres"
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:881:in initialize' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:881:innew'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:881:in connect' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:568:ininitialize'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in new' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:41:inpostgresql_connection'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in new_connection' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:incheckout_new_connection'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in acquire_connection' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:inblock in checkout'
/home/robus/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:incheckout'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in block in connection' /home/robus/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:inmon_synchronize'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in connection' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:inretrieve_connection'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_handling.rb:113:in retrieve_connection' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/connection_handling.rb:87:inconnection'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/migration.rb:910:in initialize' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:innew'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in up' /home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:inmigrate'
/home/robus/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in block (2 levels) in <top (required)>' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:240:incall'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:240:in block in execute' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:235:ineach'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:235:in execute' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain'
/home/robus/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:172:ininvoke_with_call_chain'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/task.rb:165:in invoke' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:150:ininvoke_task'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:106:in block (2 levels) in top_level' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:106:ineach'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:106:in block in top_level' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:115:inrun_with_threads'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:100:in top_level' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:78:inblock in run'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:176:in standard_exception_handling' /home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/lib/rake/application.rb:75:inrun'
/home/robus/.rvm/gems/ruby-2.1.0/gems/rake-10.2.2/bin/rake:33:in <top (required)>' /home/robus/.rvm/gems/ruby-2.1.0/bin/rake:23:inload'
/home/robus/.rvm/gems/ruby-2.1.0/bin/rake:23:in <main>' /home/robus/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:ineval'
/home/robus/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `

'
Tasks: TOP => db:migrate

You've got two things going on here:

  1. The SafeYAML Warning is because your libyaml is outdated. This shouldn't prevent you from running the application locally, but you'll want to update your version of libyaml. If you're using rvm, you can do this with rvm pkg install libyaml and rvm reinstall 2.0.0.

  2. The biggest problem here is the following error:

    PG::ConnectionBad: FATAL: Peer authentication failed for user "postgres"
    

    You can fix this by creating the "postgres" user with sudo -u postgres psql or by modifying configuration settings in config/database.yml to suit your local PostgreSQL install.

Keep in mind that questions unrelated to the project don't belong in GitHub issues. You can try asking any further questions over at Stack Overflow, though I suggest you Google your error messages first because these are pretty common.

+1 Thanks for being so polite in solving all my errors unrelated to project. I will refrain myself asking such noob questions hereafter. :)

@kbhatt2006

please try tu run: gem install pg -v '0.17.1' -- --with-pg-config=/usr/pgsql-9.3/bin/pg_config

and than you can run again: bundle install

I have the same problem with you, and that command it's works for me