passenger error Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter`, ruby 1.9.2 rails 2.3.8 - passenger

i have a problem - i have Ubuntu 12.04 server and I am trying to host ruby on rails app on it.
I have chosen passenger with apache. I have installed RVM and made gemset "ruby-1.9.2-p320#myapp" and it works. I have really old rails 2.3.8 app, which is just for archive for me and I dont have any time to update it.
I have passenger error Please install the mysql2 adapter: 'gem install activerecord-mysql2-adapter' (no such file to load -- active_record/connection_adapters/mysql2_adapter)
My "gem list":
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activerecord-mysql2-adapter (0.0.3)
activeresource (2.3.8)
activesupport (2.3.8)
bundler (1.2.3)
daemon_controller (1.1.1)
fastthread (1.0.7)
mislav-will_paginate (2.3.11)
mysql2 (0.2.7)
passenger (3.0.19)
rack (1.1.6)
rails (2.3.8)
rake (10.0.3)
rubygems-bundler (1.1.0)
rubygems-update (1.8.25, 1.3.5)
rvm (1.11.3.6)
sqlite3 (1.3.7)
sqlite3-ruby (1.3.3)
thoughtbot-paperclip (2.3.1)
will_paginate (3.0.4)
I can using ruby script/console get to database records, so connection with database is established and it WORKS.
Is there any ideas for solution?
Thank you.
If any extra info is needed, it will be provided asap.

This was misconfiguration of Passenger and Apache from my part.
Just follow these loveley tutorial and all will be OK: http://everydayrails.com/2010/09/13/rvm-project-gemsets.html
And if you afterwards run into problems of UTF-8 errors for older rails apps, just read on that here: http://railsforum.com/viewtopic.php?id=42009

Related

Ruby and activerecord-oracle_enhanced-adapter

I have a query about RadRails and the activerecord-oracle_enhanced-adapter. I am using RadRails 2.
Below is a list of my local gems, garnered from the output of the gem list –local command:
*** LOCAL GEMS ***
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activerecord-oracle_enhanced-adapter (1.6.7)
activeresource (2.3.4)
activesupport (2.3.4)
bigdecimal (1.2.6)
io-console (0.4.3)
json (1.8.1)
oracle_enhanced (1.2.5)
psych (2.0.8)
rack (1.0.1)
rails (2.3.4)
rake (10.4.2)
rdoc (4.2.0)
However, when I try to run the rake migrate command the following appears:
rake aborted!
Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (no such file to load -- active_record/connection_adapters/oracle_enhanced_adapter)
(See full trace by running task with --trace)
I have uninstalled activerecord-oracle_enhanced-adapter and reinstalled it, restarted RadRails, all to no avail.
The problem is that you using rails 2.3.4 (last updated in 2010) with the newest activerecord oracle enhanced adapter 1.6.7 that released just few weeks ago.
Try to update your rails to 4.1 (it's also requires update ruby to 2.3) or downgrade activerecord-oracle_enhanced-adapter to 1.3.2 in your Gemfile:
gem 'activerecord-oracle_enhanced-adapter', '~> 1.3', '>= 1.3.2'
Also it would be better do not use so old RadRails. Try latest ruby and rails in any modern editor or IDE!

Getting Load error -- watir-webdriver on Mac Yosemite

I have Ruby 2.2.2, I have already watir-webdriver gem installed, when I run following script
require 'rubygems'
require 'watir-webdriver'
browser = Watir::Browser.new :firefox
It gives in
`require': cannot load such file -- watir-webdriver(LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
I have rubymine 7.1.2
Here is my gem list
$ gem list
* LOCAL GEMS *
bigdecimal (1.2.6)
bundler (1.10.3)
bundler-unload (1.0.2)
childprocess (0.5.6)
executable-hooks (1.3.2)
ffi (1.9.8)
gem-wrappers (1.2.7)
io-console (0.4.3)
json (1.8.1)
multi_json (1.11.1)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
rubygems-bundler (1.4.4)
rubyzip (1.1.7)
rvm (1.11.3.9)
selenium-webdriver (2.46.2)
watir-webdriver (0.7.0)
websocket (1.2.2)
yard (0.8.7.6)
Please suggest what to do?
/System/Library/Frameworks/Ruby.framework/Versions/2.0/... is the system library in OS X Yosemite.
Ruby 2.2 (or any other version) is installed by you or some other user -- perhaps via RVM, given you have some rvm gem installed? If so you need to use RVM to change the default. If you did not install RVM correctly or ignored some warning or command it gave to you, you might want to re-install.
If you did not install Ruby 2.2 via RVM*, here are instructions for changing OS X default Ruby installed using Brew.
(*I could not recommend RVM more strongly. Other people like rbenv to do the same job.)

Ruby on Rails - New to Ruby help with rake db:migrate

I am a new user to Ruby on Rails and am having an issue with: rake db:migrate.
After I bundle install, the following comes up:
$ bundle install
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using bundler (1.0.18)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using sqlite3-ruby (1.2.5)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Then, when I try and rake db:migrate, i get the following:
$ rake db:migrate
Could not find polyglot-0.3.2 in any of the sources
Run `bundle install` to install missing gems.
Anyone have any advice? Thanks.
I am on ruby 1.8.7 and rails 3.0.9
Check where it's installed:
gem list -d polyglot
Run bundle exec to make sure rake uses what's specified in your gemfile:
bundle exec rake db:migrate
Ya..apparently the polyglot gem is not included in your gem file.
Also try doing gem install polyglot...
Hope it helps !
bundle exec rake db:migrate might help too..

Rake 0.8.7 and ActiveSupport 3.0.1

I am running Ruby 1.9.2. I have rake 0.8.7 installed. However running rake inside a Rails application gives me the following:
(in /usr/home/users/dimitar/Rails/spek)
Could not find activesupport-3.0.1 in any of the sources
Try running `bundle install`.
So I go ahead and run bundle install again and everything looks good:
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.1)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.1)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.1)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.7)
Using actionmailer (3.0.1)
Using arel (1.0.1)
Using activerecord (3.0.1)
Using activeresource (3.0.1)
Using bundler (1.0.3)
Using thor (0.14.3)
Using railties (3.0.1)
Using rails (3.0.1)
Using sqlite3-ruby (1.3.1)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
But rake still gives me the same error message. Any suggestions?
Actually the problem seems to come from the config/boot.rb file:
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Do you have multiple Ruby interpreters installed (maybe via rvm or some other method)? If so, are you sure that the right one is active?
Things to look at:
which ruby
which rake
ruby -e 'puts $:' # To show the LOAD_PATH for gems
I had a similar problem using ruby-1.9.2 and fixed it by upgrading rubygems
sudo gem update --system
I had the same problem when I was using REE 1.8.7. I switched to 1.9.2 and did bundle install. Then my rake commands worked.
I had this issue when I mistakenly ran passenger with ruby 1.9.3 and the app used 1.8.7 in its .rvmrc. Fixed by using 1.9.3 (now I have encoding problems, but thats a different story).

Connection Failed when Deploying with Capistrano in Snow Leopard

I'm trying to deploy a PHP project using Capistrano. When I try to do a cap deploy, I get an error:
wes:/var/www/nipponpulse [svn:] → cap deploy
* executing `deploy'
** transaction: start
* executing `deploy:update_code'
executing locally: "svn info https://newcitymedia.svn.beanstalkapp.com/nippon_pulse/expressionengine -rHEAD"
/opt/local/bin/svn
* executing "svn checkout -q -r94 https://newcitymedia.svn.beanstalkapp.com/nippon_pulse/expressionengine /var/www/nipponpulse/releases/20091117150904 && (echo 94 > /var/www/nipponpulse/releases/20091117150904/REVISION)"
servers: ["192.168.2.42"]
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/nipponpulse/releases/20091117150904; true"
servers: ["192.168.2.42"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: 192.168.2.42 (NoMethodError: private method `split' called for 42:Fixnum)
connection failed for: 192.168.2.42 (NoMethodError: private method `split' called for 42:Fixnum)
Here's the recipe I'm using http://pastie.textmate.org/private/7mix7xhbf3ozwjskwt5orq. I'm using Snow Leopard and here's my list of gems (using sudo gem list --local):
actionmailer (2.3.4, 2.2.2, 1.3.6)
actionpack (2.3.4, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.4, 2.2.2, 1.15.6)
activeresource (2.3.4, 2.2.2)
activesupport (2.3.4, 2.2.2, 1.4.4)
acts_as_ferret (0.4.4, 0.4.3)
adamcooke-key-installer (1.1)
capistrano (2.5.9, 2.5.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
defunkt-github (0.3.4)
dnssd (1.3.1, 1.3, 0.6.0)
fastthread (1.0.7, 1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
highline (1.5.1, 1.5.0)
hpricot (0.8.1, 0.6.164)
json_pure (1.1.9)
libxml-ruby (1.1.3, 1.1.2)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.2, 1.0.1)
net-sftp (2.0.2, 2.0.1, 1.1.1)
net-ssh (2.0.15, 2.0.4, 1.1.4)
net-ssh-gateway (1.0.1, 1.0.0)
open4 (0.9.6)
rack (1.0.1, 1.0.0)
rails (2.3.4, 2.2.2, 1.2.6)
rake (0.8.7, 0.8.3)
RedCloth (4.2.2, 4.1.1)
ruby-openid (2.1.7, 2.1.2)
ruby-yadis (0.3.4)
rubygems-update (1.3.5)
rubynode (0.1.5)
sqlite3-ruby (1.2.5, 1.2.4)
termios (0.9.4)
vlad (2.0.0)
xmpp4r (0.5, 0.4)
When I run ruby -v I see this:
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
I'm not sure why it's failing. My experience with rails and ruby in general is slim to none, but I've used Capistrano in the past and it has worked on this machine. Is there something specific with Snow Leopard that I need to fix?
Edit: updated the error
Note that the error reads "exception while rolling back", which means that the error you're seeing occurred when Capistrano was already trying to rollback due to some other error. In other words, it's a red herring. If you can include the complete output of capistrano from the command in question, someone might be able to help you identify what really went wrong.
You should examine this error:
connection failed for: 192.168.2.42 (NoMethodError: private method `split' called for 42:Fixnum)
What host is this? Local? And try to check where the NoMethodError for split comes from.
You can also fire this cap command just to see if the destination server is the one not reachable:
cap invoke COMMAND='ls -l'

Resources