2015-06-26 39 views
0

我一直在研究工作機器上的一個小型項目,回到家中試用我的筆記本電腦以及創建新的rails應用程序。這是我收到的錯誤。設置Ruby

Installing i18n (0.7.0) 
Gem::InstallError: i18n requires Ruby version >= 1.9.3. 
An error occured while installing i18n (0.7.0), and Bundler cannot continue. 
Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling. 
Jose-Gomezs-MacBook-Pro:~ josegomez$ bundle install 
Could not locate Gemfile 
Jose-Gomezs-MacBook-Pro:~ josegomez$ ruby -v 
ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-darwin10.8.0] 

所以,我試圖更新我做了一個快速檢查後更新至1.9.3

rvm install ruby-1.9.3-p551 

,當我運行了這個錯誤

`Error running './configure --prefix=/Users/josegomez/.rvm/rubies/ruby- 1.9.3-p551 --with-opt-dir=/opt/local --without-tcl --without-tk --disable- install-doc --enable-shared', 
showing last 15 lines of /Users/josegomez/.rvm/log/1435281659_ruby- 1.9.3-p551/configure.log 
GEM_HOME=/Users/josegomez/.rvm/gems/[email protected] 
PATH=/Users/josegomez/.rvm/usr/bin:/opt/local/bin:/opt/local/sbin:/Users/josegomez/.rvm/gems/ruby-1.9.2- [email protected]/bin:/Users/josegomez/.rvm/gems/[email protected]/bin:/Users/josegomez/.rvm/rubies/ruby-1.9.2-p318/bin:/Users/josegomez/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin 
GEM_PATH=/Users/josegomez/.rvm/gems/[email protected]:/Users/josegomez/.rvm/gems/[email protected] 
command(7): ./configure --prefix=/Users/josegomez/.rvm/rubies/ruby-1.9.3-p551 --with-opt-dir=/opt/local --without-tcl --without-tk --disable-install-doc --enable-shared 
configure: WARNING: unrecognized options: --without-tcl, --without-tk 
checking build system type... x86_64-apple-darwin14.0.0 
checking host system type... x86_64-apple-darwin14.0.0 
checking target system type... x86_64-apple-darwin14.0.0 
checking whether the C compiler works... yes 
checking for C compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/josegomez/.rvm/src/ruby-1.9.3-p551': 
configure: error: cannot run C compiled programs. 
If you meant to cross compile, use `--host'. 
See `config.log' for more details 
There has been an error while running configure. Halting the installation.` 

:紅寶石-v我得到:

ruby(62937,0x7fff7c0c8300) malloc: *** error for object 0x100801a08: incorrect checksum for freed object - object was probably modified after being freed. 
*** set a breakpoint in malloc_error_break to debug 
Abort trap: 6 

任何想法如何解決這個問題?

回答

0

只需複製和粘貼這些命令,如果你正在使用Ubuntu

1- sudo apt-get update 
2- sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev 
3- sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev 
4- \curl -sSL https://get.rvm.io | bash 
5- source ~/.rvm/scripts/rvm 
6- rvm install 2.2.2 
7- rvm use 2.2.2 --default 
8- ruby -v 
9- echo "gem: --no-ri --no-rdoc" > ~/.gemrc 
10- gem install bundler 
11- sudo add-apt-repository ppa:chris-lea/node.js 
12- sudo apt-get update 
12- sudo apt-get install nodejs 
14- sudo apt-get install mysql-server mysql-client libmysqlclient-dev 
15- rails new myapp -d mysql 
1

由於您使用的MacBook Pro,我會用下面去了。在命令行:

\curl -sSL https://get.rvm.io | bash -s stable --ruby 

一旦這樣做了,試試:

rvm use 2.2.2 --default 
gem install bundler 
cd /Path/to/your/rails/app 
bundle install 

請讓我知道如何去:-)

+0

這似乎工作。謝謝!但是當我運行軟件包安裝時,我仍然收到錯誤[運行軟件包安裝後](http://pastebin.com/fc5gPALE) –

+0

添加我發現我沒有安裝Rails,所以我運行它,我得到另一個[誤差(http://pastebin.com/fwBK2P5P)。我對此非常陌生,所以我想確保所有事情都正確無誤,所以我推動了我的應用程序。我似乎遇到了很多錯誤。 –

+0

而不是第一個命令,試試這個:'\ curl -sSL https://get.rvm.io | bash -s stable --rails'這會讓你得到你需要的一切;) – DaniG2k