heroku mysqltopostgres installation error - mysql

I am trying to deploy my php app that uses mysql db to heroku.
I followed instructions here - https://devcenter.heroku.com/articles/heroku-mysql
The sudo gem install mysqltopostgres-0.3.0.gem command executed without errors:
gem build mysqltopostgres.gemspec
Successfully built RubyGem
Name: mysqltopostgres
Version: 0.3.0
File: mysqltopostgres-0.3.0.gem
but when I try to execute the mysqltopostgres command, the following errors occur
mysqltopostgres /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:34:in
'block in setup': You have already activated test-unit 2.5.5, but your
Gemfile requires test-unit 3.2.1. Prepending 'bundle exec' to your
command may solve this. (Gem::LoadError) from
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:19:in 'setup' from
/usr/lib/ruby/vendor_ruby/bundler.rb:92:in 'setup' from
/usr/lib/ruby/vendor_ruby/bundler/setup.rb:8:in ''
from
/usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
'require' from
/usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
'require' from
/var/lib/gems/2.3.0/gems/mysqltopostgres-0.3.0/bin/mysqltopostgres:5:in
'' from /usr/local/bin/mysqltopostgres:22:in 'load'
from /usr/local/bin/mysqltopostgres:22:in ''
I then tried to prepend bundle exec:
bundle exec mysqltopostgres
/usr/local/lib/site_ruby/2.3.0/rubygems.rb:270:in 'find_spec_for_exe':
can't find gem mysqltopostgres (>= 0.a) (Gem::GemNotFoundException)
from /usr/local/lib/site_ruby/2.3.0/rubygems.rb:298:in
'activate_bin_path' from /usr/local/bin/mysqltopostgres:22:in
''
Has anyone ever come across these errors?
And I am new to Heroku, and I was building my app on my local apache and now I want to deploy it to heroku.

Related

Resolve error: An error occurred while installing mysql2 (0.4.5), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.4.5'`

I am trying to build a docker image by running the command:
docker build -t user:repository .
and keep getting this error:
An error occurred while installing mysql2 (0.4.5), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.4.5'` succeeds before bundling.
The command '/bin/sh -c /bin/bash -l -c "gem install bundler && bundle install"' returned a non-zero code: 5
What I've Tried
gem install mysql2 -v '0.4.5'`
gets an error
ERROR: Could not find a valid gem 'mysql2' (= 0.4.5), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
and after running the suggestion from this repo and this website I get the error:
Could not find a valid gem 'C:rubygems-update-2.6.7.gem' (>= 0) in any repository
I am stuck at this point for I have no idea where this problem stems from. Any help would be very much appreciated.
When I run bundle update I get an
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about
OpenSSL certificates, see. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
try to run bundle update. I had a similar problem and that worked for me... good luck!
A Dockerfile would be useful here, but let's take a random stab.
If you use ubuntu, the base install does not include any ca certificates so SSL does not work properly. Try installing the packages 'ssl' and 'ca-certificates'.

heroku rake db:migrate ERROR "gem install activerecord-mysql-adapter"

im using Rails 3.2.6 trying to run
heroku run rake db:migrate
i get the adaptar ERROR
rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
in my database.yml i have development, production, and test set to:
adapter: mysql2
this is my gem env
➜ my_app git:(master) gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [x86_64-darwin11.4.2]
- INSTALLATION DIRECTORY: /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327
- RUBY EXECUTABLE: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
- EXECUTABLE DIRECTORY: /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327
- /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
i have tried a few things i found googling, no luck. any help appreciated! thanks!
Remember that Heroku uses the config property DATABASE_URL instead of your database.yml file for connecting to your db. Make sure it is set. If you are using the ClearDB add-on, then the value you want should be in the CLEARDB_DATABASE_URL.
heroku config
Copy the value that ClearDB will have set for you in the CLEARDB_DATABASE_URL config variable. Set the DATABASE_URL to the same value
heroku config:set DATABASE_URL=mysql2://bb06ca765fb123:71b6dabc#us-cdbr-east-04.cleardb.com/heroku_703eded6aebc123?reconnect=true
Here's the catch. Most people are using the mysql2 gem, so you typically need to set the DATABASE_URL to mysql2... instead of mysql.
There's no need to abandon mysql and migrate to postgre.
On Heroku, your best option for a database is postgresql, hands down. There are a handful of reasons that boil down to: that's how Heroku was designed to work.
If you're simply using the rails orm you can use the mysql2psql gem in your development environment and change your config files to use postgresql in production.
If you're really married to mysql for whatever reason, you'll need to install a heroku addon to get your app up and running. There are a couple options but here's one: https://addons.heroku.com/cleardb
But really, your best bet is to migrate your app to postgresql, it's worth it.
More info here:
https://devcenter.heroku.com/articles/heroku-mysql

Sphinx cannot be found on your system.

I am using my rails application in ubuntu12.04. I just installed thinkingsphinx and sphinx using these commands.
sudo apt-get install sphinxsearch
sudo gem install thinking-sphinx
But thinking-sphinx version is 1.4.11 but i want 1.3.20. So i installed thinking-sphinx with version as 1.3.20.
After that i started indexing through rake ts:index
But i am getting this error.
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
Please install RDoc 2.4.2+ to generate documentation.
Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
rake aborted!
uninitialized constant MysqlCompat::MysqlRes
Tasks: TOP => environment
(See full trace by running task with --trace)
I searched regarding this issue.. and after that I modified my config/sphinx.yml file as
development:
bin_path: "/usr/bin"
searchd_binary_name: searchd
indexer_binary_name: indexer
port: 9110
morphology: stem_en
enable_star: true
html_strip: 1
min_infix_len: 2
and i installed sudo gem install mysql also.
Still the problem is not resolved..
Please can anyone suggest ideas to resolve this problem..
Thanks a lot in advance.
I think you need to run sphinx deamon. It can be done with
sudo service sphinxsearch restart command. Try it.

Error with mysql2 gem loading Rails env on OSX: "Symbol not found: _rb_prohibit_interrupt"

I'm on OSX 10.7.5
I'm setting up an existing Rails 3 app
I've got the 64-bit dmg package of MySQL (v5.5.28) installed
I've installed the mysql2 gem (v0.3.11) as part of the app bundle
Whenever i try to load the rails env (raking, loading console, etc.), I get this:
rake aborted!
dlopen(/Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2/mysql2.bundle, 9): Symbol not found: _rb_prohibit_interrupt
Referenced from: /Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2/mysql2.bundle
Expected in: flat namespace
in /Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2/mysql2.bundle - /Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2/mysql2.bundle
/Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2.rb:9:in require'
/Users/daretorant/.rvm/gems/ruby-1.9.3-p194#amp/bundler/gems/mysql2-f4d004ac5194/lib/mysql2.rb:9:in'
.........
Things I've tried:
other versions of mysql2
fresh install of mysql itself
cleaning my gemset
cleaning rvm
pulling hair out
Help?
I have just run into this issue. What had helped me was installing the 64bit version of the mysql2 gem, like this:
$ env ARCHFLAGS="-arch x86_64" gem install mysql2

Unable to Install Redmine on Win 2008R2 .. gem install activerecord-mysql-adapter not working

While trying to install Redmine on Windows Server 2008 R2, I struck into following error we no solutions found...
It is asking to install something, and when try to install it says it don't find it. It suggested activerecord-mysql2-adapter, but even that is not working...
I'm now starting to believe that ROR sucks....
C:\Ruby\Apps\Redmine>rake db:migrate
rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (193:
%1 is not a valid Win32 application. - C:/Ruby187/lib/ruby/gems/1.8/gems/mysq
l-2.8.1-x86-mingw32/lib/1.8/mysql_api.so)
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
C:\Ruby\Apps\Redmine>gem install activerecord-mysql-adapter
ERROR: Could not find a valid gem 'activerecord-mysql-adapter' (>= 0) in any re
pository
ERROR: Possible alternatives: activerecord-mysql2-adapter, activerecord-jdbcmys
ql-adapter, activerecord-jdbc-adapter, activerecord-ruby_mysql-adapter, activere
cord-fb-adapter
Depending on the adapter line of your database.yml try gem install mysql or gem install mysql2.
possibly error in your database connection, verify your mysql is running and if running verify your sql connection setting in database.yml
I too faced this problem, but changing database.yml connection worked for me