Question

Import Ruby on Rails App From Github

  • Posted November 7, 2014

I can’t seem to get this app running from Github. It looks like a complete app (https://github.com/harrystech/prelaunchr) but whatever I do, it won’t work on the 1 click ruby on rails droplet. Any ideas on what steps I need to take to get it up and running? There is only one guide on here, and it’s not very helpful… Thanks in advance!

Subscribe
Share

I followed every step but constantly getting error connecting to mysql:

root@prelaunch:/home/rails# bundle exec rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/rvm/gems/ruby-2.1.3/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
	from /usr/local/rvm/gems/ruby-2.1.3/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `initialize'
	from /usr/local/rvm/gems/ruby-2.1.3/gems/activerecord-3.2.11/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
	from /usr/local/rvm/gems/ruby-2.1.3/gems/activerecord-3.2.11/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
	from /usr/local/rvm/gems/ruby-2.1.3/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'

database.yml looks like this:

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: mysql2
  database: prelaunchr
  host: localhost

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql2
  database: test
  host: localhost

production:
  adapter: mysql2
  database: rails
  password: XXXXXX
  host: localhost

@asb can you please help somehow, I’m googling for hours but nothing helped.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@asb Update: It seems I’ve been using the wrong password. But, now it gives me another error: could not connect to server: Connection refused Is the server running on host “localhost” (127.0.0.1) and accepting TCP/IP connections on port 5432?

Hey,

I’ve been reading this upside and down and I cant seem to get this to work.

My problem is with the mysql password. When I run “bundle exec rake db:create db:schema:load db:seed”, I get:

“Access denied for user ‘root’@‘localhost’ (using password: NO). Please provide the root password for your mysql installation”

I haven’t set the user name and password in the database.yml file, as I can’t figure out where to put it. I’ve tried entering the information in basically every possible place, but nothing I do seems to work. I’d love some help!

Hi!

There are a number of things going on here that make this not as straight forward as it could be. First, prelaunchr is set up to use Postgress as it’s database by default while the one-click app is pre-installed with MySql. Next, prelaunchr want to use older versions of a number of gems that come preinstalled on the image. So we need to uninstall them and install the need versions. Finally, there seems to be an issue with the default asset settings for prelaunchr.

Using the following steps, I was able to get prelaunchr up and running:

rm -rf /home/rails/*
cd  /home/rails/
git clone https://github.com/harrystech/prelaunchr.git .
nano Gemfile # Add "gem 'mysql2'"
nano config/database.yml # Change 'postgres' to 'mysql2' and add user/pass for the database
gem list | cut -d" " -f1 | xargs gem uninstall -aIx  # Uninstall gems that might conflict
bundle install
bundle exec rake db:create db:schema:load db:seed
nano config/environments/production.rb # Set `config.assets.compile = true`
chown -R rails:www-data *
service unicorn restart