我最近安裝了rvm,在當前系統中使用rails5以及rails3.x版本。當我試圖創造新的rails5應用程序,我已經得到了以下錯誤Rails - mysql2安裝錯誤
Could not find proper version of railties (3.2.13) in any of the sources
Run `bundle install` to install missing gems.
,當我嘗試做捆綁安裝,我被困這個
gem install mysql2 -v '0.3.11'
Building native extensions. This could take a while...
/home/himanth/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /home/himanth/.rvm/gems in PATH, mode 040777
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/home/himanth/.rvm/rubies/ruby-2.3.1/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling mysql2_ext.c
In file included from ./client.h:11:0,
from ./mysql2_ext.h:39,
from mysql2_ext.c:1:
/home/himanth/.rvm/rubies/ruby-2.3.1/include/ruby-2.3.0/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete [-Wcpp]
In file included from ./mysql2_ext.h:39:0,
from mysql2_ext.c:1:
./client.h: In function 'rb_thread_blocking_region':
./client.h:23:3: error: 'TRAP_BEG' undeclared (first use in this function)
./client.h:23:3: note: each undeclared identifier is reported only once for each function it appears in
./client.h:25:3: error: 'TRAP_END' undeclared (first use in this function)
mysql2_ext.c: At top level:
./client.h:16:1: warning: 'rb_thread_blocking_region' defined but not used [-Wunused-function]
make: *** [mysql2_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/himanth/.rvm/gems/[email protected]/gems/mysql2-0.3.11 for inspection.
Results logged to /home/himanth/.rvm/gems/[email protected]/extensions/x86_64-linux/2.3.0/mysql2-0.3.11/gem_make.out
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
卡住了與此相當長的一段時間,任何幫助將不勝感激。
嘗試把這個在你的Gemfile做捆綁安裝後, gem'mysql2','〜> 0.3.18' – Navin
我甚至沒有完成創建項目,當我嘗試創建新的項目,我得到這個錯誤.. 在任何來源找不到適當版本的railties(3.2.13) 運行'bundle install'來安裝缺失的gem。 這是令人困惑的.. –
RVM是爲ruby版本,而不是rails版本。如果您已在系統級別安裝了rails 3和rails 5 gem,則在運行rails時,可能需要告訴系統要使用哪個rails版本(http://stackoverflow.com/a/452458/385532) – Matt