Installing locally through vagrant


(Mihai Raulea) #1

I get this error, when running the rake command in my vagrant machine. I followed the tutorial here:

I am using Mac OS X El Capitan.

Here is the error:

vagrant@discourse:/vagrant$ bundle exec rake db:migrate
DEPRECATION WARNING: Sprockets method register_engine is deprecated.
Please register a mime type using register_mime_type then
use register_compressor or register_transformer.


(called from <top (required)> at /vagrant/lib/es6_module_transpiler/sprockets.rb:3)
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /home/vagrant/.rvm/gems/ruby-2.3.1/gems/ember-data-source-2.3.0.beta.5/dist/ember-data.js

I thought vagrant was supposed to make this painless?


(Mihai Raulea) #2

very nice, no answer :slight_smile:


(Mihai Raulea) #3

anyhow, i am getting badges like crazy, so i got that going for me


(Mittineague) #4

If you are on a Mac or PC, please try our Discourse as Your First Rails App blog post first!

Did you try that first and have no luck with it?


(Mihai Raulea) #5

hello, thanks for your answer! this is exactly where the error occurs; inside the vagrant env. i am not a newbie, but i am no ruby dev. the production(a VPS with Ubuntu) offers the same exquisite error.


(cpradio) #6

By chance did you run bundle install?

I know @tarek did some work on the vagrant image a short while ago, so you may want to check out this topic (ignore anything at the OS level but anything after vagrant ssh is fair game)


(Mittineague) #7

Hmmm. re the Deprecated, this file was last commited 2 years ago


(Mihai Raulea) #8

yes, i did. thank you for the resource, i will look into it.


(Mihai Raulea) #9

yes, maybe there is some compatibility issue with that?


(cpradio) #10

Hopefully sometime towards this weekend, I’ll be able to find time to try a fresh vagrant setup. I know I won’t have time today, but I’ll try to see if I can work something in later in this week (granted, I don’t own a Mac, so it will be a slightly different experience, but if your issues are truly within Vagrant itself, it shouldn’t matter). :slight_smile:


(Mihai Raulea) #11

thank you. yes, assuming VirtualBox does the job it is supposed to do. and i am guessing so. let me know if i can assist with anything.


(cpradio) #12

So my sound rehearsal ended early tonight and I got a chance to destroy my current vagrant image and up it again… and it works. I don’t get any errors about sprockets :frowning:

Can you run the following after vagrant ssh?

cd /vagrant
bundle check
bundle show sprockets

Here are my results, for comparison:

vagrant@discourse:/vagrant$ bundle check
The Gemfile's dependencies are satisfied
vagrant@discourse:/vagrant$ bundle show sprockets
/home/vagrant/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3

(石老师) #13

Hi, I got the same error, and have no idea now, how about you


(cpradio) #14

Can you provide the output for bundle check and bundle show sprockets? I’d like to see if those got installed properly on your vagrant instance.


(石老师) #16

I am sorry about the format, cause I can’t post more than 2 links


(石老师) #17
here it is:
songsong@Gialib001deMini:~/Workspace/github/discourse|master⚡ 
⇒  rake db:migrate
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
 https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from <top (required)> at /Users/songsong/Workspace/github/discourse/lib/es6_module_transpiler/sprockets.rb:3)
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/songsong/.rvm/gems/ruby-2.3.0/gems/ember-data-source-2.3.0.beta.5/dist/ember-data.js
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/ember-rails-0.18.5/lib/ember_rails.rb:68:in `block in <class:Railtie>'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/Users/songsong/Workspace/github/discourse/config/environment.rb:5:in `<top (required)>'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:328:in `require_environment!'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/Users/songsong/.rvm/gems/ruby-2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/Users/songsong/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/Users/songsong/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment

(cpradio) #18

Can you run the following? I still can’t recreate this and so I’m trying to figure out why Vagrant is behaving differently for you and @Mihai_Raulea than it is for me.

cd /vagrant
ruby -v
bundle check
bundle show sprockets

I have

vagrant@discourse:/vagrant$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
vagrant@discourse:/vagrant$ bundle check
The Gemfile's dependencies are satisfied
vagrant@discourse:/vagrant$ bundle show sprockets
/home/vagrant/.rvm/gems/ruby-2.3.1/gems/sprockets-3.6.3

(石老师) #19

I solved it, the error shows:

No such file or directory @ rb_sysopen - /Users/songsong/.rvm/gems/ruby-2.3.0/gems/ember-data-source-2.3.0.beta.5/dist/ember-data.js

So I checked the /Users/songsong/.rvm/gems/ruby-2.3.0/gems/ember-data-source-2.3.0.beta.5/, no /dist dictionary here.

Then I uninstall the ember-rails gem and modify Gemfile: I remove the version after gem ‘ember-rails’, next run bundle install again, and it worked for me.
Thanks a lot :sweat_smile: