简体   繁体   English

没有therubyracer gem的MacOSX Lion运行服务器

[英]MacOSX Lion run server without therubyracer gem

I was using a cloud9 ide online but I had to install gem rmagick . 我当时在cloud9 ide online使用cloud9 ide online但必须安装gem rmagick But the ide did not let me to do and gave an error. 但是这个想法并没有让我去做,并且犯了一个错误。 So I decided to download my project in to my local area. 因此,我决定将项目下载到本地。 Then when I try to bundle install, it throws and error for therubyracer . 然后,当我尝试捆绑安装时, therubyracer会抛出错误。

I though Osx has its own way to handle java part. 我虽然Osx有其自己的方式来处理Java部分。 So if i take out gem rubyracer from gem file, bundle install works fine. 因此,如果我从宝石文件中取出宝石rubyracer ,捆绑安装效果很好。 But then when i say rails server , i get an error; 但是当我说rails server ,我得到了一个错误。

rails server
[WARNING] Please install gem 'therubyracer' to use Less.
bin/rails:6: warning: already initialized constant APP_PATH
/Users/emreozkan/Desktop/yedek/Last.1/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

EDIT 1: 编辑1:

bundle install with gem thrubyracer; 与gem thrubyracer捆绑安装;

Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies......
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.6.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.0
Using rack 1.6.0
Using rack-test 0.6.3
Using actionpack 4.2.0
Using globalid 0.3.5
Using activejob 4.2.0
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemodel 4.2.0
Using arel 6.0.0
Using activerecord 4.2.0
Using ansi 1.5.0
Using bcrypt 3.1.7
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.3.pre1
Using sass 3.4.13
Using bootstrap-sass 3.2.0.0
Using will_paginate 3.0.7
Using bootstrap-will_paginate 0.0.10
Using bundler 1.9.1
Using columnize 0.9.0
Using debugger-linecache 1.2.0
Using slop 3.6.0
Using byebug 3.4.0
Using carrierwave 0.10.0
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.0
Using coderay 1.1.0
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.0
Using coffee-rails 4.1.0
Using commonjs 0.2.7
Using ffi 1.9.8
Using formatador 0.2.5
Using rb-fsevent 0.9.4
Using rb-inotify 0.9.5
Using listen 2.10.0
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Using notiffany 0.0.6
Using method_source 0.8.2
Using pry 0.10.1
Using guard 2.12.5
Using guard-minitest 2.3.1
Using multi_json 1.11.0
Using jbuilder 2.2.3
Using jquery-rails 4.0.3
Using less 2.6.0
Using sprockets 3.0.1
Using tilt 1.4.1
Using less-rails 2.7.0
Using libv8 3.16.14.7
Using sprockets-rails 2.2.4
Using rails 4.2.0
Using mini_backtrace 0.1.3
Using ruby-progressbar 1.7.5
Using minitest-reporters 1.0.5
Using pg 0.17.1
Using rails_serve_static_assets 0.0.4
Using rails_stdout_logging 0.0.3
Using rails_12factor 0.0.2
Using rdoc 4.2.0
Using ref 1.0.5
Using rmagick 2.13.2
Using sass-rails 5.0.1
Using sdoc 0.4.0
Using spring 1.1.3
Using sqlite3 1.3.9

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/opt/ruby/bin/ruby -r ./siteconf20150421-1458-ss9mv4.rb extconf.rb --pre
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... 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
    --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/Cellar/ruby/2.2.1/bin/$(RUBY_BASE_NAME)
    --with-pthreadlib
    --without-pthreadlib
    --with-objclib
    --without-objclib
    --enable-debug
    --disable-debug
    --with-v8-dir
    --without-v8-dir
    --with-v8-include
    --without-v8-include=${v8-dir}/include
    --with-v8-lib
    --without-v8-lib=${v8-dir}/lib
/usr/local/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.7/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.7 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

    from /usr/local/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.7/lib/libv8.rb:7:in `configure_makefile'
    from extconf.rb:32:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.2.0/gems/therubyracer-0.12.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-11/2.2.0/therubyracer-0.12.2/gem_make.out
An error occurred while installing therubyracer (0.12.2), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.2'` succeeds before bundling.

EDIT 2: 编辑2:

My gem file; 我的宝石文件;

source 'https://rubygems.org'

gem 'rails',                '4.2.0'
gem 'json',             '~> 1.8.2'
gem 'execjs'
gem 'bcrypt',               '3.1.7'
gem 'will_paginate',           '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass',       '3.2.0.0'


gem 'carrierwave'
gem 'rmagick',              '2.13.2'
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'sass-rails',           '5.0.1'
gem 'uglifier',             '2.5.3'
gem 'coffee-rails',         '4.1.0'
gem 'jquery-rails',         '4.0.3'
gem 'turbolinks',           '2.3.0'
gem 'jbuilder',             '2.2.3'
gem 'sdoc',                 '0.4.0', group: :doc

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
end

I had a similar problem installing Rails on a Rapsberry Pi because therubyracer has no package for arm processors. 我在Rapsberry Pi上安装Rails时遇到了类似的问题,因为therubyracer没有用于手臂处理器的软件包。

It can be solved installing node.js which you can download here: https://nodejs.org/download/ 可以通过安装node.js来解决,可以在这里下载: https : //nodejs.org/download/

After you installed it you can remove therubyracer from your Gemfile and run bundle again. 安装后,您可以从Gemfile中删除therubyracer ,然后再次运行bundle After you did that everything should be fine... 完成后,一切都会好起来的...

// You also need to add this line to your Gemfile: //您还需要将此行添加到Gemfile中:

gem 'execjs'

Then run bundler again. 然后再次运行bundler

Its described here: http://ajacevedo.com/2013/using-node-js-as-a-rails-javascript-runtime/ 其描述如下: http : //ajacevedo.com/2013/using-node-js-as-a-rails-javascript-runtime/

// IN your case the Less Gem requires therubyracer not rails itself. //在您的情况下, Less Gem要求therubyracer本身不行。 So its a gem specific problem. 因此,这是一个宝石特有的问题。 It has been discribed here: https://github.com/seyhunak/twitter-bootstrap-rails/issues/336 它已在这里描述: https : //github.com/seyhunak/twitter-bootstrap-rails/issues/336

One of the guys seemed to solve it this way: 一个家伙似乎是这样解决的:

... Anyways, removed both gems, 'therubyracer' and 'less-rails-bootstrap'. ...无论如何,都删除了'therubyracer'和'less-rails-bootstrap'这两个宝石。 Now using 'bootstrap-sass'. 现在使用“ bootstrap-sass”。

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

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