Installing locally through vagrant

I get this error, when running the rake command in my vagrant machine. I followed the tutorial here:
https://github.com/discourse/discourse/blob/master/docs/VAGRANT.md

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.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(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?

very nice, no answer :slight_smile:

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

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?

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.

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)

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

https://github.com/discourse/discourse/blob/master/lib/es6_module_transpiler/sprockets.rb

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

yes, maybe there is some compatibility issue with that?

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:

1 Like

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.

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
3 Likes

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

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.

I am sorry about the format, cause I canā€™t post more than 2 links

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
1 Like

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
4 Likes

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:

4 Likes