Forum: Ruby on Rails Problem with installing gems and run server (weird, the project run so well yesterday)

Be6584d65dc1fd7a0a7c52c38d0e677b?d=identicon&s=25 Fernando Segura Gòmez (Guest)
on 2014-03-10 19:47
(Received via mailing list)
Good afternoon
Excuse me, i have a problem with rails 4.0.0,  i've been working with
this
framework for the last 4 months, without any problem or issue, but now
when
i try to run one server on windows so, a project to i've been working
for
the last week and working fine, appear this error:

------------------------------------------------------------------
Bundler::GemNotFound: Could not find mysql2-0.3.11 in any of the
sources....
      materialize at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/spec_set.rb:92
             map! at org/jruby/RubyArray.java:2441
      materialize at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/spec_set.rb:85
            specs at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/definition.rb:133
        specs_for at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/definition.rb:178
  requested_specs at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/definition.rb:167
  requested_specs at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/environment.rb:18
            setup at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/runtime.rb:13
            setup at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler.rb:119
           (root) at
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
/bundler/setup.rb:17
          require at org/jruby/RubyKernel.java:1083
           (root) at
C:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_re
quire.rb:1
          require at
C:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_re
quire.rb:135
          require at org/jruby/RubyKernel.java:1083
           (root) at
C:/Users/fernando/rubyonrails/tampicomusic/config/boot.rb:4

           (root) at
C:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_re
quire.rb:1
           (root) at bin/rails:3

-------------------------------------------------------------------



When i try to install the gem(again, because i have installed before)
with
bundle install ( if i install the gem with, gem install, appear a
message
telling the gem not found) appear this error:


--------------------------------------------------------------------------------------
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension
.

    c:/jruby-1.7.10/bin/jruby.exe extconf.rb
NotImplementedError: C extension support is not enabled. Pass
-Xcext.enabled=tru
e to JRuby or set JRUBY_OPTS.

   (root) at c:/jruby-1.7.10/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1083
   (root) at
c:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb
:1

---------------------------------------------------------------


¿What's going on?.
My projects working so well yesterday, i never seen that logs, and i
confused when i see the path jruby.
My version for rails: 4.0.0 rc1
My version for ruby: 1.9.3p385 (2013-02-06) [i386-mingw32]
S.O : Windows 7 64 bits.
F50d3b02eee623a2172b58c09fe31c2c?d=identicon&s=25 mike (Guest)
on 2014-03-10 23:21
(Received via mailing list)
On Monday, March 10, 2014 2:46:14 PM UTC-4, Fernando Segura Gòmez wrote:
>       materialize at
> C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
>             setup at
> C:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_re
> -------------------------------------------------------------------
> Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
>    (root) at
> My version for ruby: 1.9.3p385 (2013-02-06) [i386-mingw32]
> S.O : Windows 7 64 bits.
>

It's not your application, it's the environment.  Both the PostgreSQL
and
MySQL gems have portions written in C that must be compiled locally on
each
machine.  If it can't complete the compile, the gem doesn't install.
That
is what's happening on your server.  The code requires a C extension
that
your system is not giving it access to.

It appears that you're running jruby (ruby running in a java virtual
machine) and on Windows.  I can't help you with either one, sorry, but
that's the issue.
F7141e066d691d7f18765c1ea6389b18?d=identicon&s=25 Serguei Cambour (javix)
on 2014-03-11 09:08
(Received via mailing list)
On Monday, March 10, 2014 7:46:14 PM UTC+1, Fernando Segura Gòmez wrote:
>       materialize at
> C:/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.3/lib
>             setup at
> C:/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_re
> -------------------------------------------------------------------
> Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
>    (root) at
> My version for ruby: 1.9.3p385 (2013-02-06) [i386-mingw32]
> S.O : Windows 7 64 bits.
>

It is right; you are running JRuby and not ruby; If it's the case, you
should install all the needed gems by prefixing it as follows:

jruby -S bundle install

If not, I had the same problem on a Windows box, i.e. JRuby had some
priorities on the Ruby installation. The only way to fix it was to
uninstall JRuby completely and everything came back to the normal.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2014-03-11 12:45
(Received via mailing list)
On Monday, March 10, 2014 6:46:14 PM UTC, Fernando Segura Gòmez wrote:
>
>
> ¿What's going on?.
> My projects working so well yesterday, i never seen that logs, and i
> confused when i see the path jruby.
> My version for rails: 4.0.0 rc1
> My version for ruby: 1.9.3p385 (2013-02-06) [i386-mingw32]
> S.O : Windows 7 64 bits.
>

It looks like you've installed jruby, which requires different gems for
some things. It doesn't sound like you wanted this at all, so you've
either
got to

- remove jruby
- change your PATH environment variable so that it doesn't appear ahead
of
'normal' ruby
- use something like uru ( https://bitbucket.org/jonforums/uru/ ) to
manage
multiple rubies

Fre
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.