NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Issues installing mysql gem w/ macports mysql install

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
DanS



Joined: 26 Oct 2008
Posts: 2

PostPosted: Sun Oct 26, 2008 3:31 pm    Post subject: Issues installing mysql gem w/ macports mysql install Reply with quote

Hi, I'm using NetBeans 6.5_RC1 on OSX 10.5.5 and have run into the following issue with Rails on NetBeans.

Basically rake works for me from the console but does not seem to work when called from NetBeans.

In the project window right clicking a project and selecting 'migrate database' then choosing 'To Current Version' gives the following error:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql


When I try to fix this by going to 'Tools/Ruby Gems' and installing the mysql gem (version 2.7.3) I get this error:

ERROR: Failed to build gem native extension.

I think this is because I used MacPorts to install mysql and the installer isn't finding the mysql files. I was able to get the gem installer to work from the console by appending the argument "--with-mysql-config=/opt/local/bin/mysql_config5" to the gem install command. Unfortunately NetBeans doesn't seem to use the gems installed in this manner and I'm not finding any affordance to pass an option like this when using the NetBeans gem installer.

I would appreciate advice on how to resolve this issue.
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Mon Oct 27, 2008 8:08 am    Post subject: Issues installing mysql gem w/ macports mysql install Reply with quote

Hi,

Just to be sure, could you please double-check that you're using the
same platform from the IDE (in Project Properties -> Rails -> Ruby
Platform) and from the command line? Can you also specify what is the
platform that you're using?

Thanks,
Erno


DanS wrote:
Quote:
Hi, I'm using NetBeans 6.5_RC1 on OSX 10.5.5 and have run into the following issue with Rails on NetBeans.



Basically rake works for me from the console but does not seem to work when called from NetBeans.



In the project window right clicking a project and selecting 'migrate database' then choosing 'To Current Version' gives the following error:



!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.

rake aborted!

no such file to load -- mysql



When I try to fix this by going to 'Tools/Ruby Gems' and installing the mysql gem (version 2.7.3) I get this error:



ERROR: Failed to build gem native extension.



I think this is because I used MacPorts to install mysql and the installer isn't finding the mysql files. I was able to get the gem installer to work from the console by appending the argument "--with-mysql-config=/opt/local/bin/mysql_config5" to the gem install command. Unfortunately NetBeans doesn't seem to use the gems installed in this manner and I'm not finding any affordance to pass an option like this when using the NetBeans gem installer.



I would appreciate advice on how to resolve this issue.











Back to top
DanS



Joined: 26 Oct 2008
Posts: 2

PostPosted: Mon Oct 27, 2008 1:02 pm    Post subject: Reply with quote

I switched the platform setting and rake now works for me from the NetBeans menu.

For the record I had the platform set to:
Built-in JRuby 1.1.4 (rake didn't work)

When I changed it to:
Ruby 1.8.6-p114 (rake started working)

Erno, thanks for the gentle hint on how to fix this.

Dan
Back to top
Pooja



Joined: 24 Nov 2012
Posts: 1

PostPosted: Sat Nov 24, 2012 12:37 pm    Post subject: Gem Installation failed.. Reply with quote

Hi,
I have installed netbeans 6.8 on my windows system.
I m trying to create one rails application and successfully built a model class(contact.rb).
Now on rails console when I type:
my_contact=Contact.new

it gives me the following error:

my=Contact.new
C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/shared/jruby/openssl/gem_only.rb:3 warning: already initialized constant GEM_ONLY
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
MissingSourceFile: no such file to load -- mysql
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/requires.rb:7:in `require_library_or_gem'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:60:in `mysql_connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1271:in `columns'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:3007:in `attributes_from_column_definition'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
from C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2434:in `initialize'
from (irb):3:in `new'


Using cmd prompt I installed the mysql gem but dont how to do it using netbeans. As Dan said, I changed the project property to ruby 1.9.3-p125

Still it is showing the same error...
Sad


Let me point out one more point here:

When i see rails plugins of my project, it shows:


Missing the Rails 2.3.4 gem. Please `gem install -v=2.3.4 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
Back to top
zeeshan



Joined: 26 Nov 2012
Posts: 2

PostPosted: Fri Dec 14, 2012 9:55 am    Post subject: Reply with quote

Hello-

Trying to get rails up and running on my linux box with mysql. When I
try to install the mysql gem, I get the following:

Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql
Code:
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no

*** 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=/usr/local/bin/ruby
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib



Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/
gem_make.out

I've tried setting the config option and other various things when
running 'gem install'.

Anyone know how to get around this? Thanks very much.
________________________
http://www.creditexpertguide.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo