我不明白为什么我的第一个Elixir脚本失败

时间:2019-02-19 08:55:24

标签: elixir

我正在尝试学习长生不老药。

我发现了这个演示语法:

dan@h78:~/elxr/public/notes $ elixir pmap1.exs
** (SyntaxError) pmap1.exs:18: unexpected token: "​" (column 38, codepoint U+200B)
    (elixir) lib/code.ex:767: Code.require_file/2
dan@h78:~/elxr/public/notes $ 

我将上面的语法放在一个文件中:pmap1.exs

接下来,我尝试使用一个简单的shell命令运行它:

source 'https://rubygems.org'

ruby '2.4.1'
gem 'rails', '~>5.0.6'
# gem 'mysql2'
gem 'pg'
gem 'responders'
gem 'fast_blank'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: 'c8ac844' ### to get rid of Ruby 2.4+ deprecation errors
gem 'axlsx_rails' # must come before spreadsheet_architect, see patch in config/initializers/axlsx_rails_spreadsheet_architect_patch.rb
gem 'spreadsheet_architect'
gem 'activerecord-import'

gem 'devise'
gem 'devise_invitable'
gem 'cancancan'
gem 'rolify'
gem "paranoia"
gem 'pretender'
gem 'audited'

# gem 'chosen-rails'

gem "paperclip"
gem "paperclip_utils"
gem 'search_cop'
gem 'sucker_punch'
gem 'rearmed'
gem 'rearmed_rails'
gem 'premailer-rails'

gem 'slim-rails'
gem 'simple_form'
gem 'kaminari'
# gem 'bootswatch'
# gem 'bootstrap'
gem 'jquery-rails'

gem 'cocoon'
gem 'bootstrap-sass'
gem 'font-awesome-rails'
gem 'autoprefixer-rails'
gem 'sass-rails'
gem 'uglifier'
gem 'bootstrap-modal-rails'
gem 'toastr-rails'
gem 'remotipart', github: 'mshibuya/remotipart'
# gem 'rails_admin', '>= 1.0.0.rc'

source "https://rails-assets.org" do
  gem 'rails-assets-autoNumeric','~>1'
  gem 'rails-assets-bootstrap-datepicker'
  gem 'rails-assets-jquery', '~>2'
  gem 'rails-assets-jquery-ujs'
  gem 'rails-assets-autosize', '~>3'
  gem 'rails-assets-select-sync'
  gem 'rails-assets-bootstrap3-typeahead'
  gem 'rails-assets-floatThead'
  gem 'rails-assets-chosen'
  gem 'rails-assets-chosen-bootstrap'
  gem 'rails-assets-chosen-material-theme'
  gem 'rails-assets-bootstrap-directional-buttons'
end

我运行不正确吗?

我在某处有语法错误吗?

1 个答案:

答案 0 :(得分:1)

由于某种原因,在代码示例中,有两个“零宽度空格”(Unicode代码点200B),*字符的每一侧都有一个。删除两个零宽度的空格后,您的代码对我来说运行正常。

(您正在为result分配一个值,但没有打印它或对其进行其他操作,因此它说warning: variable "result" is unused,但这是下一步。IO.inspect(result)是一种快速的操作这样的方式。)