简体   繁体   English

在Ruby on Rails上安装时出错

[英]Error while installing Ruby on Rails

I am trying to install Ruby on Rails on my local machine for development purposes, but I have hit upon an error. 我正在尝试出于开发目的在本地计算机上安装Ruby on Rails,但是遇到了一个错误。 I can't quite tell, but it seems like it might be a gem error. 我不太清楚,但似乎可能是个错误。 Though, this is my first time trying to use all three, Ruby, Gem and Rails, so I'm not sure. 虽然,这是我第一次尝试同时使用Ruby,Gem和Rails这三种,所以我不确定。

Running the command "sudo gem install rails -V" these are the last few lines printed after the error is hit: 运行命令“ sudo gem install rails -V”,这是错误发生后最后打印的几行:

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)  
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:13:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/atomic-1.1.14 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/atomic-1.1.14/ext/gem_make.out

The version of Ruby installed is: 安装的Ruby版本为:

ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

The version of gem is: gem的版本是:

1.8.23

From the atomic gem README . atomic宝石README中获取

As of 1.1.0, JDK8 is required to build the atomic gem, since it attempts to use the new atomic

Please install Java, then re-run the gem install process. 请安装Java,然后重新运行gem安装过程。

What Linux do you have? 您有什么Linux?

On Mint, i did: 在Mint上,我做到了:

sudo apt-get install git
sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable --ruby
sudo apt-get install git-core
source ~/.rvm/scripts/rvm
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm autolibs enable
rvm reload
rvm requirements
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
rvm install ruby-2.0
curl -L https://get.rvm.io | bash -s stable --rails

and it works fine. 而且效果很好。 This will (currently) install Ruby 2.0 and rails 4.0 however. (当前)这将安装Ruby 2.0和rails 4.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM